@Stefan, thank you for the reply.
I have rephrased my query and posted to a new thread here:
https://groups.google.com/forum/#!topic/ansible-project/tzFtb4MRZN0
Please suggest as feasible.
On Monday, September 23, 2019 at 10:25:44 PM UTC+5:30, Stefan Hornburg
(Racke) wrote:
>
> On 9/23/19 2:50 PM, Mohtashim S wrote:
> > command_result variable get database record while could be multi-line.
> >
> > The below helps me loop over each record of the database.
> >
> > |
> > -debug:
> > msg:"This is a database line: {{ item }}"
> > with_items:"{{ command_result.stdout_lines }}"
> > |
> >
> > What I now need is to trigger a fresh play like below for each loop
> iteration and its values.
> >
> > |
> > -hosts:"{{ item.stdout.split('\t')[0] }}"
> > tasks:
> > -name:Checkifreboot isrequired
> > shell:/home/ansible/scripts/check.sh "{{
> item.stdout.split('\t')[1] }}"
> > register:output
> >
> >
> > -debug:var=output.stdout_lines
> >
> >
> > -add_host:name={{item }}
> > groups=dest_nodes
> > ansible_user={{USER }}
> > with_items:"{{ dest_ip.split(',') }}"
> > |
> >
> > The item value will change on each loop and that will be fed to the play
> above.
> >
> > Can you please guide me how to achieve this ?
>
> What do you mean with "trigger a fresh play" ?
>
> Regards
> Racke
>
> >
> > --
> > 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:> <mailto:
> [email protected] <javascript:>>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/ansible-project/6a730169-fd2b-4a34-836e-2addb50d8490%40googlegroups.com
>
> > <
> https://groups.google.com/d/msgid/ansible-project/6a730169-fd2b-4a34-836e-2addb50d8490%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
>
>
>
> --
> Ecommerce and Linux consulting + Perl and web application programming.
> Debian and Sympa administration. Provisioning with Ansible.
>
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/864934e3-27a2-4be5-824a-2890d022618a%40googlegroups.com.