Hi,

    I have created my own custom library , i added my custom library in the 
common folder of my repository.In that i need to pass variables 
dyanamically .Its a confidential password,so iam using "vault" in ansible.

  In that my requirement is how to pass include_vars in the tasks\main.yml 
before hosts.

e.g: mytasks.yml
  - include_vars: sample_vault.yml
  - include: sample_tasks.yml
  - hosts: localhost
    tasks:
      name: "free task"
      command: ls -a

my directory structure like this:

  myfolder
    - common 
        -library   
           -my file.py
        - sample_tasks.yml

    - mytasks
        -mytasks.yml(my main master playbook file)
        -sample_vault.yml  (note:i create this using vault for confidential 
purpose)
        - roles
           -myrole


Here i need to run sample_tasks file using a variables passed in 
sample_vault.yml file before i execute the hosts tasks using ansible.If i 
use extra variable means password is visible so i dont need that.

When i use include_vars in my tasks/main.yml file, it shows the following 
error:

"ERROR! 'include_vars' is not a valid attribute for a Play"




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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ebf24244-84dc-4bfe-b9c5-689525714178%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to