ansible : deployment automation
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
|
||||
Loading…
Reference in New Issue