ansible - How to disable gathering facts for subplays not included within given tag -


several of playbooks have sub-plays structure this:

- hosts: sites   user: root   tags:     - configuration   tasks:   (...)  - hosts: sites   user: root   tags:     - db   tasks:   (...)  - hosts: sites   user: "{{ site_vars.user }}"   tags:     - app   tasks:   (...) 

in ansible 1.x both admins , developers able use such playbook. admins run tags (root , user access), while developers had access last tag tasks @ user access level. when developers run playbook app tag, gathering facts skipped first 2 tags. however, in ansible 2.1, not being skipped, causes failure users without root access.

is there mechanism or easy modification fix behaviour? there new approach should applied such cases now?

there easy mod – turn off facts gathering , call setup explicitly:

- hosts: sites   user: root   tags:     - configuration   gather_facts: no   tasks:     - setup:     (...) 

Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -