"  with_nested:
   - 'john'
   - 'john1234'
   - 'sample.sql'
   - ['localhost','%']

It looks like the first should be a list of usernames, and the second
should be a list of files, but you are specifying strings instead -- which
is what you would do if those were variable names.

with_nested:
     - [ 'john', 'john1234' ]
     - [ 'sampel.sql']
     - [ 'localhost', '%' ]

OR:

with_nested:
     - db_users
     - sql_files
     - hosts

etc




On Thu, May 15, 2014 at 3:51 AM, Wynne Pirini <[email protected]> wrote:

> Hi there
>
> I've searched for days for a clear and straight forward answer to this
> question.
>
> In the following nested loop I want to use variables instead of the static
> values I have there.
>
> - name: Create/assign database users to db and grant permissions
>   mysql_user: name={{ item[0] }} password={{ item[1] }} priv={{ item[2]
> }}.*:ALL state=present login_host={{ item[3] }}
>   with_nested:
>    - 'john'
>    - 'john1234'
>    - 'sample.sql'
>    - ['localhost','%']
>
> Actually, that doesn't even work. So I'm already stuck.
>
> Then in my group_vars I have defined variables:
>
>     env:
>       db_import: sample.sql
>       db_name: sample_db
>       db_user: john
>       db_password: john1234
>
>
> I've tried all sorts of ways of using variables instead of the static
> values.
>
> Can anyone help me with this?
>
> Thanks in advance.
>
> --
> 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/4e82e4ab-168a-4672-91e5-114cb268de1b%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/4e82e4ab-168a-4672-91e5-114cb268de1b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CA%2BnsWgz-Rrg5ZrkLE6ECuakUMmt7pAmhJykh1SFSGCY5_QA0rQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to