On 10. mars 2017 04:36, Vinicius Leal wrote:
Hi guys i saw the following example:

  - include: wordpress.yml
    vars:
        wp_user: timmy
        ssh_keys:
          - keys/one.txt
          - keys/two.txt

But when we have a large list of vars is it possible to do something like:

  - include: wordpress.yml
    var_file: vars/var1.yml

So we can run many times the same task but with different arguments.

You could do something like this.

- include: wordpress.yml
  vars:
    var_file: vars/var1.yml


And at the top in the wordpress file add a include_vars

wordpress.yml
---
- include_vars: "{{ var_file }}"


--
Kai Stian Olstad

--
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/7f829c26-fb66-773c-f69d-733d62f4c382%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to