Examples for Ansible Lab
- Create EC2 instance for control machine
- Install Ansible on it
- Clone this repo:
git clone https://github.com/camilotorres97/ansible-lab.git
cd ansible-lab
- ad-hoc commands
ansible -m ping all
ansible -m ping localhost
ansible -m shell -a "whoami" localhost
- playbook commands
ansible-playbook -i inventory playbook.yml
ansible-playbook -i inventory-prod playbook.yml -l db
ansible-playbook -i inventory-test playbook.yml -t apache-install