I'm trying to dynamically set which vault I'm using (don't want my test 
environment to use real passwords!).

So I set up this in a play book that I'm doing an import_playbook from a 
different directory.

If vault_file is set from the ansible-playbook command line, this works. If 
I set the vault_file from a group vars file from the calling playbook's dir, 
vault_file doesn't exist from for the vars_files a statement's viewpoint. 
 If I set it in a fact vault_file also doesn't exist from the vars_files 

But oddly enough, if I debug vault_file in the debug role, it prints out 
correctly in all three cases.

Bug, or feature?  And how do I work around this?



# Sets up Docker networks


- name: Setup the networks

  hosts: dockerhosts


     - demoVars.yml

     - "{{ vault_file }}"


    - role: debug

    - role: network_setup


        internal: "{{ networks.internal }}"

        external: "{{ networks.external }}"

        nginx: "{{ networks.nginx }}"


    - setup

    - standalone

    - app_test

---- importing file ----

- name: create facts used to compose variables later in this playbook

  hosts: dockerhosts


    esTmpDir: "/tmp/es"


    - role: unitenv_setup


    - app_test

- import_playbook: ../../../deployment/playbooks/network.yml

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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to