Thanks for your help, I'll give this a go. On Thursday, May 15, 2014 11:36:44 PM UTC+12, Michael DeHaan wrote: > > " 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]<javascript:> > > 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] <javascript:>. >> To post to this group, send email to [email protected]<javascript:> >> . >> 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/07dd85c3-6e57-4c71-a5cb-4c7680e208c4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
