cd ubuntu-server
docker build -t ubuntu-server-local .
docker run -itd --name ubuntu-server-local -p 2222:22 ubuntu-server-local
Test: ssh test@vm01 -p 2222
- Ping:
ansible all -m ping
- Verify inventory:
ansible-inventory -i inventory.yaml --list
- Ping:
ansible virtualmachines -m ping -i inventory.yaml
ansible leafs -m ping -i inventory.yaml
ansible spines -m ping -i inventory.yaml
- Run playbook:
ansible-playbook -i inventory.yaml playbooks/ping.yaml
A major difference between import and include tasks:
import
tasks will be parsed at the beginning when you run your playbookinclude
tasks will be parsed at the moment Ansible hits them
- A module is a reusable piece of code that performs specific tasks on managed node