ansible : deployment automation

main
YIk Teng Hie 5 years ago
parent 74f3e9c124
commit 8ab7c439e3

@ -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

@ -52,10 +52,12 @@ $ chmod 777 filename
## node version manager [nvm](https://github.com/nvm-sh/nvm) ## node version manager [nvm](https://github.com/nvm-sh/nvm)
* version manger for nodejs * For proper installing, using version manager for nodejs to install nodejs/npm
* use nvm to avoid npm version conflict installation * use nvm
* ubuntu 20.10 support node 12 * to avoid npm version conflict installation with nodejs
* ubuntu 19.10 support node 10 * 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 ```shell
// installation // 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 $ 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")" $ 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 // to install node version 10.10.0
$ nvm install 10.10.0 $ nvm install 10.10.0

Loading…
Cancel
Save