nfaction / ansible-tips-and-tricks

Tips and Tricks for using Ansible
102 stars 17 forks source link

tags used instead of skip-tags for skip example #2

Closed arbabnazar closed 8 years ago

arbabnazar commented 8 years ago

@lenards @johnworth @ianmcorvidae @dennisroberts71 @jerry57 kindly review the change. Thanks

lenards commented 8 years ago

I'd give this a 👍

The suggested context is only plays/roles not matching 'sudoers' (aka "skip any 'sudoers' tags plays/roles").

$ ansible --version 
ansible 2.1.0.0
  config file = /opt/dev/atmosphere-ansible/ansible/ansible.cfg
  configured module search path = ['/usr/share/ansible']
$ ansible-playbook --help | grep -A3 tags
  --list-tags           list all available tags
  --list-tasks          list all tasks that would be executed
  -M MODULE_PATH, --module-path=MODULE_PATH
                        specify path(s) to module library
--
  --skip-tags=SKIP_TAGS
                        only run plays and tasks whose tags do not match these
                        values
  --start-at-task=START_AT_TASK
                        start the playbook at the task matching this name
--
  -t TAGS, --tags=TAGS  only run plays and tasks tagged with these values
  --vault-password-file=VAULT_PASSWORD_FILE
                        vault password file
  -v, --verbose         verbose mode (-vvv for more, -vvvv to enable
lenards commented 8 years ago

@nfaction / @amercer1

nfaction commented 8 years ago

Great catch @arbabnazar ! Thank you for your pull request!!

arbabnazar commented 8 years ago

Thanks @nfaction