From 8ab7c439e3168120a631676db1ee7ec678c11e7f Mon Sep 17 00:00:00 2001 From: YIk Teng Hie Date: Sat, 22 May 2021 19:28:03 +0800 Subject: [PATCH] ansible : deployment automation --- ansible/README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++ ubuntu/README.md | 14 +++++++++----- 2 files changed, 58 insertions(+), 5 deletions(-) create mode 100644 ansible/README.md diff --git a/ansible/README.md b/ansible/README.md new file mode 100644 index 0000000..d5060be --- /dev/null +++ b/ansible/README.md @@ -0,0 +1,49 @@ +# [Ansible](https://docs.ansible.com/) + +* deployment automation +* Windows Installation ([WSL](https://geekflare.com/ansible-installation-windows/)) + +```shell +$ sudo apt install ansible + +$ nano testbook.yml + +``` + +* `testbook.yml` + +```yml +--- + +- name: testing ansible + hosts: localhost + tasks: + + - name: echo a message + debug: msg="this is working" +``` + +* Run the playbook + +```shell +$ ansible-playbook ./testbook.yml --connection=local + +/// +PLAY [testing ansible] ***************************************************************************************** + +TASK [Gathering Facts] ***************************************************************************************** +ok: [localhost] + +TASK [echo a message] ****************************************************************************************** +ok: [localhost] => { + "msg": "this is working" +} + +PLAY RECAP ***************************************************************************************************** +localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 + +``` + + + +* installation ok \ No newline at end of file diff --git a/ubuntu/README.md b/ubuntu/README.md index 7c3fa5c..8ffbb9b 100644 --- a/ubuntu/README.md +++ b/ubuntu/README.md @@ -52,10 +52,12 @@ $ chmod 777 filename ## node version manager [nvm](https://github.com/nvm-sh/nvm) -* version manger for nodejs -* use nvm to avoid npm version conflict installation -* ubuntu 20.10 support node 12 -* ubuntu 19.10 support node 10 +* For proper installing, using version manager for nodejs to install nodejs/npm +* use nvm + * to avoid npm version conflict installation with nodejs + * to install / switch to lower / newer version on any version ubuntu +* ubuntu 20.10 default support node 12 +* ubuntu 19.10 default support node 10 ```shell // installation @@ -65,7 +67,9 @@ $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bas $ wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash $ export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + +# This loads nvm +$ [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" // to install node version 10.10.0 $ nvm install 10.10.0