Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Simple Ansible test setup
- =========================
- ## Execute on localhost
- If the tasks are simple enough and/or non-invasive.
- $ ansible -c local -i localhost, -m ping all
- localhost | SUCCESS => {
- "changed": false,
- "failed": false,
- "ping": "pong"
- }
- $ ansible-playbook -c local -i localhost, test.yml
- PLAY [all] *******************************************************************
- TASK [Gathering Facts] *******************************************************
- ok: [localhost]
- TASK [Sample task 1] *********************************************************
- changed: [localhost]
- TASK [Sample task 2] *********************************************************
- changed: [localhost]
- PLAY RECAP *******************************************************************
- localhost : ok=3 changed=2 unreachable=0 failed=0
- ## Execute on remote host
- $ vagrant up
- $ vagrant snapshot save init
- $ ansible -i ./inventory -m ping all
- ubuntu16.04-x86_64 | SUCCESS => {
- "changed": false,
- "failed": false,
- "ping": "pong"
- }
- $ ansible-playbook -i ./inventory test.yml
- PLAY [all] *******************************************************************
- TASK [Gathering Facts] *******************************************************
- ok: [ubuntu16.04-x86_64]
- TASK [Sample task 1] *********************************************************
- changed: [ubuntu16.04-x86_64]
- TASK [Sample task 2] *********************************************************
- changed: [ubuntu16.04-x86_64]
- PLAY RECAP *******************************************************************
- ubuntu16.04-x86_64 : ok=3 changed=2 unreachable=0 failed=0
- $ vagrant snapshot restore init
Add Comment
Please, Sign In to add comment