Run specific tags

Execute only tasks marked with specified tags

ansible-playbook site.yml --tags 'config,restart' -i inventory.ini

tool
ansible56 commands
tags
ansible

More ansible commands

  • ansible-playbook site.yml --skip-tags 'slow,optional' -i inventory.ini

    Skip tasks with specified tags

  • ansible-playbook site.yml -vvv -i inventory.ini 2>&1 | tee /tmp/ansible.log

    Maximum 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.yml

    Display decrypted content of a vault-encrypted file

  • ansible all -m copy -a 'src=./nginx.conf dest=/etc/nginx/nginx.conf owner=root mode=0644' -i inventory.ini

    Push a local file to all hosts with specific permissions

all 56 ansible commands