CLI
- Read more about CLI
- Log in to post comments
# fallback: install required python2 over SSH on remote machine
ansible example.com -i inventory -u root -m raw -a "apt-get update && apt-get install -y python-minimal"
# Ad-hoc commands
ansible all -i inventory.list -l localhost -u root -m ping
ansible all -s -m shell -a "hostname -f"
ansible all -s -m apt -a 'pkg=nginx state=installed update_cache=true'
# uptime
ansible all -i inventories/dev -l www -u root -a uptime
ansible all -m shell -a "apt-get update"
ansible www.example.com -m setup
ansible all -m setup -i inventory/example.com -u root > /tmp/example.com.inventory.$(da