How to have different settings "gather fact" in two roles of playbook

316 views
Skip to first unread message

Ivan Korjavin

unread,
Dec 14, 2014, 2:41:06 PM12/14/14
to ansible...@googlegroups.com
I have playbook with a lot of roles,
A few of them, can't use "gather facts" cos, no python is avalible at that time, this roles use "raw" and install python.

But after that another rules must have gather facrs due to using facts in templates.

How to combine this in one playbook?

Michael DeHaan

unread,
Dec 15, 2014, 6:58:49 AM12/15/14
to ansible...@googlegroups.com
- hosts: whichever
  gather_facts: False
  tasks:
    - ... install python ...

- hosts:  whichever
  gather_facts: True # or omit for default
  tasks:
     - ...

The same could be done with roles, or even a playbook that includes another, like:

- include: setup_python.yml
- include: regular_config.yml

Let me know if you have more questions on this!  Thanks!



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/fa372782-9e1b-4c0a-8cc4-bb68ab595a25%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages