You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.1 KiB
Markdown
49 lines
1.1 KiB
Markdown
|
5 years ago
|
# [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
|