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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to