Run with extra vars
Override variables from the command line
ansible-playbook deploy.yml -e 'env=prod version=2.1.0' -i inventory.ini
More ansible commands
-
ansible-playbook site.yml --limit 'web-01,web-02' -i inventory.iniRun the playbook only on the listed hosts
-
ansible-playbook site.yml --tags 'config,restart' -i inventory.iniRun only the tasks with these tags
-
ansible-playbook site.yml --skip-tags 'slow,optional' -i inventory.iniSkip tasks with these tags
-
ansible-playbook site.yml -vvv -i inventory.ini 2>&1 | tee /tmp/ansible.logMaximum verbosity for debugging, with a copy saved to a log file
-
ansible-vault encrypt_string 'supersecret' --name 'db_password'Encrypt one value so you can paste it straight into playbook vars