Limit to specific hosts
Run playbook only on specified hosts
ansible-playbook site.yml --limit 'web-01,web-02' -i inventory.ini
More ansible commands
-
ansible-playbook site.yml --tags 'config,restart' -i inventory.iniExecute only tasks marked with specified tags
-
ansible-playbook site.yml --skip-tags 'slow,optional' -i inventory.iniSkip tasks with specified tags
-
ansible-playbook site.yml -vvv -i inventory.ini 2>&1 | tee /tmp/ansible.logMaximum verbosity for debugging; save to log
-
ansible-vault encrypt_string 'supersecret' --name 'db_password'Inline-encrypt a value for use in playbook vars
-
ansible-vault view group_vars/all/vault.ymlDisplay decrypted content of a vault-encrypted file