Ping all hosts
Verifies connectivity and python availability on all inventory hosts.
ansible all -m ping -i inventory.ini
13 commands from the cloud runbook. Fill in a placeholder once and every command uses it.
Verifies connectivity and python availability on all inventory hosts.
ansible all -m ping -i inventory.ini
Runs a playbook in check mode to see what would change without actually changing anything.
ansible-playbook playbook.yml --check --diff
Collects system information (facts) from a specific host.
ansible <hostname> -m setup
Executes a one-off shell command on all hosts.
ansible all -m shell -a 'uptime' -i inventory.ini
Encrypts a sensitive file (like secrets.yml) using Ansible Vault.
ansible-vault encrypt secrets.yml
Decrypts and displays the contents of a vault-encrypted file.
ansible-vault view secrets.yml
Displays the host/group structure of your inventory as a tree.
ansible-inventory --graph -i inventory.ini
Runs only the tasks tagged with a specific tag.
ansible-playbook playbook.yml --tags deploy
Installs a collection of modules and plugins from Ansible Galaxy.
ansible-galaxy collection install community.general
Checks playbooks for best practices and potential issues.
ansible-lint playbook.yml
Runs a playbook only on the hosts or groups you name.
ansible-playbook playbook.yml -i inventory.ini --limit <host>
Starts a playbook at the named task and asks before running each one.
ansible-playbook playbook.yml -i inventory.ini --start-at-task "<task-name>" --step
Reads a value from stdin (finish with Ctrl+D) and prints an encrypted variable to paste into a vars file.
ansible-vault encrypt_string --stdin-name '<variable-name>'