List inventory groups
Show the top-level keys of the parsed inventory: the groups and _meta
ansible-inventory -i inventory --list | jq 'keys'
More ansible commands
-
ansible-playbook playbook.yml -e 'env=prod version=2.0'Pass extra variables at runtime; they override the playbook defaults
-
ansible-playbook playbook.yml -vvvMaximum verbosity: every task, connection and output
-
ansible-playbook playbook.yml --syntax-checkCheck the playbook syntax without running any tasks
-
ansible all -m ping -i inventory.iniCheck SSH access and Python on all hosts
-
ansible webservers -m shell -a 'uptime && free -h' -i inventory.iniRun a shell command on all hosts in the webservers group