Run specific tags
Run only the tasks with these tags
ansible-playbook site.yml --tags 'config,restart' -i inventory.ini
More ansible commands
-
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
-
ansible-vault view group_vars/all/vault.ymlShow the decrypted contents of a vault file; the file itself stays encrypted
-
ansible all -m copy -a 'src=./nginx.conf dest=/etc/nginx/nginx.conf owner=root mode=0644' -i inventory.iniCopy a local file to all hosts with a set owner and mode