include_vars doesn't seem to persist across hosts

53 views
Skip to first unread message

David Neudorfer

unread,
Jan 30, 2015, 5:32:13 PM1/30/15
to ansible...@googlegroups.com
I'm required to

    - name: include consul secrets
      include_vars: /tmp/secrets.yml

for each set of -hosts:

Is it possible to include this file at the beginning and not have to call it for every host?

Brian Coca

unread,
Jan 30, 2015, 5:43:19 PM1/30/15
to ansible...@googlegroups.com
use vars_files at the play level, include_vars is designed to
specifically work as you describe.


--
Brian Coca

David Neudorfer

unread,
Jan 30, 2015, 5:56:05 PM1/30/15
to ansible...@googlegroups.com
Is it possible to have an ansible task that generates the /tmp/secrets.yml. The playbook fails because secrets.yml doesn't exist until the first task is run.

Brian Coca

unread,
Jan 30, 2015, 5:56:48 PM1/30/15
to ansible...@googlegroups.com
you can use multiple plays


--
Brian Coca

David Neudorfer

unread,
Jan 30, 2015, 6:16:32 PM1/30/15
to ansible...@googlegroups.com
I run ansible-playbook from within a docker container so files that are created don't persist across subsequent runs. I was able to create a includes_vars task under hosts: all which fixes the issue for me.

Thanks!
Reply all
Reply to author
Forward
0 new messages