- debug:
msg: "User was {{ item.split('\t')[3] }}"
with_items: "{{ command_result.stdout_lines }}""msg": "User was FrontEnd"
"msg": "User was BackEnd"
- debug:
vars:
USER: "{{ 'user1' if item.split('\t')[3] == 'FrontEnd' else 'user2' }}"
msg: "User is {{ USER }}"
with_items: "{{ command_result.stdout_lines }}""msg": "User is user1"
"msg": "User is user2"
TASK [debug] ************************************************************************************************************************************************
ok: [localhost] => (item=10.12.1.13 10.12.1.13\n-rw-rw-r-- user1 2019-09-13 15:39 /was//testingjsp/testingcom.jsp 1786385840 /was//testingjsp FrontEnd) => {
"msg": "User was FrontEnd"
}
ok: [localhost] => (item=10.12.1.13 10.12.1.13\n-rw-rw-r-- user2 2019-09-13 15:29 /fin/scripts/testingscr.scr 367595418\n-rw-rw-r-- user2 2019-09-13 15:36 /fin/mrt/testingmrt.mrt 1251350031\n-rw-rw-r-- user2 2019-09-13 15:37 /fin/exe/testingexe.exe 1390265645\n-rw-rw-r-- user2 2019-09-13 15:38 /fin/com/testingcom.com 90193476 /fin/scripts\n/fin/mrt\n/fin/exe\n/fin/com BackEnd) => {
"msg": "User was BackEnd"
}
TASK [debug] ************************************************************************************************************************************************
ok: [localhost] => (item=10.12.1.13 10.12.1.13\n-rw-rw-r-- user1 2019-09-13 15:39 /was//testingjsp/testingcom.jsp 1786385840 /was//testingjsp FrontEnd) => {
"msg": "Hello world!"
}
ok: [localhost] => (item=10.12.1.13 10.12.1.13\n-rw-rw-r-- user2 2019-09-13 15:29 /fin/scripts/testingscr.scr 367595418\n-rw-rw-r-- user2 2019-09-13 15:36 /fin/mrt/testingmrt.mrt 1251350031\n-rw-rw-r-- user2 2019-09-13 15:37 /fin/exe/testingexe.exe 1390265645\n-rw-rw-r-- user2 2019-09-13 15:38 /fin/com/testingcom.com 90193476 /fin/scripts\n/fin/mrt\n/fin/exe\n/fin/com BackEnd) => {
"msg": "Hello world!"
}
> > ansible...@googlegroups.com <javascript:> <mailto:ansible-project+unsub...@googlegroups.com <javascript:>>.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/ansible-project/11286705-639c-43e2-8e0d-47080203cfc1%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/11286705-639c-43e2-8e0d-47080203cfc1%40googlegroups.com>
> >
> <https://groups.google.com/d/msgid/ansible-project/11286705-639c-43e2-8e0d-47080203cfc1%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ansible-project/11286705-639c-43e2-8e0d-47080203cfc1%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
---
- name: "Play 1"
hosts: localhost
gather_facts: no
tasks:
- name: "Search database"
command: > mysql --user=root --password=p@ssword deployment
--host=localhost -Ns -e "SELECT dest_ip,file_dets,install_dir,layer FROM deploy_dets"
register: command_result
- debug:
msg: "User was {{ item.split('\t')[3] }}"
with_items: "{{ command_result.stdout_lines }}"
- debug:
vars:
USER: "{{ 'user1' if item.split('\t')[3] == 'FrontEnd' else 'user2' }}"
msg: "User is {{ USER }}"
with_items: "{{ command_result.stdout_lines }}" - debug:
msg: "User was {{ item.split('\t')[3] }}"
with_items: "{{ command_result.stdout_lines }}"
- debug:
vars:
USER: "{% if item.split('\t')[3] == 'FrontEnd' %}user1{% else %}'user2'{% endif %}"
msg: "User is {{ USER }}"
with_items: "{{ command_result.stdout_lines }}"
- debug:
msg: "{% if item.split('\t')[3] == 'FrontEnd' %}user1{% else %}'user2'{% endif %}"
with_items: "{{ command_result.stdout_lines }}"TASK [debug] ************************************************************************************************************************************************
ok: [localhost] => (item=10.12.1.13 10.12.1.13\n-rw-rw-r-- user1 2019-09-13 15:39 /was//testingjsp/testingcom.jsp 1786385840 /was//testingjsp FrontEnd) => {
"msg": "User was FrontEnd"
}
ok: [localhost] => (item=10.12.1.13 10.12.1.13\n-rw-rw-r-- user2 2019-09-13 15:29 /fin/scripts/testingscr.scr 367595418\n-rw-rw-r-- user2 2019-09-13 15:36 /fin/mrt/testingmrt.mrt 1251350031\n-rw-rw-r-- user2 2019-09-13 15:37 /fin/exe/testingexe.exe 1390265645\n-rw-rw-r-- user2 2019-09-13 15:38 /fin/com/testingcom.com90193476 /fin/scripts\n/fin/mrt\n/fin/exe\n/fin/com BackEnd) => {
"msg": "User was BackEnd"
}
TASK [debug] ************************************************************************************************************************************************
ok: [localhost] => (item=10.12.1.13 10.12.1.13\n-rw-rw-r-- user1 2019-09-13 15:39 /was//testingjsp/testingcom.jsp 1786385840 /was//testingjsp FrontEnd) => {
"msg": "Hello world!"
}
ok: [localhost] => (item=10.12.1.13 10.12.1.13\n-rw-rw-r-- user2 2019-09-13 15:29 /fin/scripts/testingscr.scr 367595418\n-rw-rw-r-- user2 2019-09-13 15:36 /fin/mrt/testingmrt.mrt 1251350031\n-rw-rw-r-- user2 2019-09-13 15:37 /fin/exe/testingexe.exe 1390265645\n-rw-rw-r-- user2 2019-09-13 15:38 /fin/com/testingcom.com90193476 /fin/scripts\n/fin/mrt\n/fin/exe\n/fin/com BackEnd) => {
"msg": "Hello world!"
}
TASK [debug] ************************************************************************************************************************************************
ok: [localhost] => (item=10.12.1.13 10.12.1.13\n-rw-rw-r-- user1 2019-09-13 15:39 /was//testingjsp/testingcom.jsp 1786385840 /was//testingjsp FrontEnd) => {
"msg": "'user2'"
}
ok: [localhost] => (item=10.12.1.13 10.12.1.13\n-rw-rw-r-- user2 2019-09-13 15:29 /fin/scripts/testingscr.scr 367595418\n-rw-rw-r-- user2 2019-09-13 15:36 /fin/mrt/testingmrt.mrt 1251350031\n-rw-rw-r-- user2 2019-09-13 15:37 /fin/exe/testingexe.exe 1390265645\n-rw-rw-r-- user2 2019-09-13 15:38 /fin/com/testingcom.com90193476 /fin/scripts\n/fin/mrt\n/fin/exe\n/fin/com BackEnd) => {
"msg": "'user2'"
}
> > > ansible...@googlegroups.com <javascript:> <mailto:ansible-project+unsub...@googlegroups.com <javascript:>
> <javascript:>>.
> > > To view this discussion on the web visit
> > > https://groups.google.com/d/msgid/ansible-project/11286705-639c-43e2-8e0d-47080203cfc1%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/11286705-639c-43e2-8e0d-47080203cfc1%40googlegroups.com>
> > <https://groups.google.com/d/msgid/ansible-project/11286705-639c-43e2-8e0d-47080203cfc1%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/11286705-639c-43e2-8e0d-47080203cfc1%40googlegroups.com>>
> > >
> >
> <https://groups.google.com/d/msgid/ansible-project/11286705-639c-43e2-8e0d-47080203cfc1%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ansible-project/11286705-639c-43e2-8e0d-47080203cfc1%40googlegroups.com?utm_medium=email&utm_source=footer>
>
> >
> <https://groups.google.com/d/msgid/ansible-project/11286705-639c-43e2-8e0d-47080203cfc1%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ansible-project/11286705-639c-43e2-8e0d-47080203cfc1%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
> > ansible...@googlegroups.com <javascript:> <mailto:ansible-project+unsub...@googlegroups.com <javascript:>>.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/ansible-project/d2354140-209e-4554-b057-95514e0ba08c%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/d2354140-209e-4554-b057-95514e0ba08c%40googlegroups.com>
> >
> <https://groups.google.com/d/msgid/ansible-project/d2354140-209e-4554-b057-95514e0ba08c%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ansible-project/d2354140-209e-4554-b057-95514e0ba08c%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
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3334f9fb-28f4-4155-9206-32b6a4a9ad29%40googlegroups.com.
- debug:
var:
USER: "{% if item.split('\t')[3] == 'FrontEnd' %}user1{% else %}'user2'{% endif %}" with_items: "{{ command_result.stdout_lines }}"ERROR! 'var' is not a valid attribute for a Task
The error appears to be in '/app/testinclude.yml.bkp': line 24, column 6, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- debug:
^ hereTo unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.
- set_fact:
USER: "user1"
when: item.split('\t')[3] == "FrontEnd"
with_items: "{{ command_result.stdout_lines }}"
- set_fact:
USER: "user2"
when: item.split('\t')[3] == "BackEnd"
with_items: "{{ command_result.stdout_lines }}"
- debug:
msg: "User has {{ USER }}"
with_items: "{{ command_result.stdout_lines }}"
TASK [debug] ************************************************************************************************************************************************
ok: [localhost] => (item=10.12.1.13 10.12.1.13\n-rw-rw-r-- user1 2019-09-13 15:39 /was//testingjsp/testingcom.jsp 1786385840 /was//testingjsp FrontEnd) => {
"msg": "User has user2"
}
ok: [localhost] => (item=10.12.1.13 10.12.1.13\n-rw-rw-r-- user2 2019-09-13 15:29 /fin/scripts/testingscr.scr 367595418\n-rw-rw-r-- user2 2019-09-13 15:36 /fin/mrt/testingmrt.mrt 1251350031\n-rw-rw-r-- user2 2019-09-13 15:37 /fin/exe/testingexe.exe 1390265645\n-rw-rw-r-- user2 2019-09-13 15:38 /fin/com/testingcom.com 90193476 /fin/scripts\n/fin/mrt\n/fin/exe\n/fin/com BackEnd) => {
"msg": "User has user2"
}
>> > > > ansible...@googlegroups.com <javascript:> <mailto:ansible-project+unsub...@googlegroups.com
>> > > ansible...@googlegroups.com <javascript:> <mailto:ansible-project+unsub...@googlegroups.com
>> <javascript:>>.
>> > > To view this discussion on the web visit
>> > >
>> https://groups.google.com/d/msgid/ansible-project/d2354140-209e-4554-b057-95514e0ba08c%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/d2354140-209e-4554-b057-95514e0ba08c%40googlegroups.com>
>> >
>> <https://groups.google.com/d/msgid/ansible-project/d2354140-209e-4554-b057-95514e0ba08c%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/d2354140-209e-4554-b057-95514e0ba08c%40googlegroups.com>>
>> > >
>> >
>> <https://groups.google.com/d/msgid/ansible-project/d2354140-209e-4554-b057-95514e0ba08c%40googlegroups.com?utm_medium=email&utm_source=footer
>> <https://groups.google.com/d/msgid/ansible-project/d2354140-209e-4554-b057-95514e0ba08c%40googlegroups.com?utm_medium=email&utm_source=footer>
>>
>> >
>> <https://groups.google.com/d/msgid/ansible-project/d2354140-209e-4554-b057-95514e0ba08c%40googlegroups.com?utm_medium=email&utm_source=footer
>> <https://groups.google.com/d/msgid/ansible-project/d2354140-209e-4554-b057-95514e0ba08c%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
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msgid/ansible-project/0dec0bef-8fdd-436b-8872-114d8c54ef3b%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/0dec0bef-8fdd-436b-8872-114d8c54ef3b%40googlegroups.com>
>> >
>> <https://groups.google.com/d/msgid/ansible-project/0dec0bef-8fdd-436b-8872-114d8c54ef3b%40googlegroups.com?utm_medium=email&utm_source=footer
>> <https://groups.google.com/d/msgid/ansible-project/0dec0bef-8fdd-436b-8872-114d8c54ef3b%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 ansible...@googlegroups.com
>> <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/3334f9fb-28f4-4155-9206-32b6a4a9ad29%40googlegroups.com
>> <https://groups.google.com/d/msgid/ansible-project/3334f9fb-28f4-4155-9206-32b6a4a9ad29%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> 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
> <mailto:ansible-project+unsub...@googlegroups.com <javascript:>
> >> > > ansible...@googlegroups.com <javascript:> <mailto:ansible-project+unsub...@googlegroups.com
> >> > ansible...@googlegroups.com <mailto:ansible-project+unsub...@googlegroups.com <javascript:>>.
> >> > To view this discussion on the web visit
> >> >
> https://groups.google.com/d/msgid/ansible-project/0dec0bef-8fdd-436b-8872-114d8c54ef3b%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/0dec0bef-8fdd-436b-8872-114d8c54ef3b%40googlegroups.com>
> >>
> <https://groups.google.com/d/msgid/ansible-project/0dec0bef-8fdd-436b-8872-114d8c54ef3b%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/0dec0bef-8fdd-436b-8872-114d8c54ef3b%40googlegroups.com>>
> >> >
> >>
> <https://groups.google.com/d/msgid/ansible-project/0dec0bef-8fdd-436b-8872-114d8c54ef3b%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ansible-project/0dec0bef-8fdd-436b-8872-114d8c54ef3b%40googlegroups.com?utm_medium=email&utm_source=footer>
>
> >>
> <https://groups.google.com/d/msgid/ansible-project/0dec0bef-8fdd-436b-8872-114d8c54ef3b%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ansible-project/0dec0bef-8fdd-436b-8872-114d8c54ef3b%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 ansible...@googlegroups.com
> >> <javascript:>.
> >> To view this discussion on the web visit
> >> https://groups.google.com/d/msgid/ansible-project/3334f9fb-28f4-4155-9206-32b6a4a9ad29%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/3334f9fb-28f4-4155-9206-32b6a4a9ad29%40googlegroups.com>
> >>
> <https://groups.google.com/d/msgid/ansible-project/3334f9fb-28f4-4155-9206-32b6a4a9ad29%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ansible-project/3334f9fb-28f4-4155-9206-32b6a4a9ad29%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
> >
> > --
> > 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
> > ansible...@googlegroups.com <javascript:> <mailto:ansible-project+unsub...@googlegroups.com <javascript:>>.
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/ansible-project/ffea2fd3-ed21-4d94-a5f9-8ce66e18876f%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/ffea2fd3-ed21-4d94-a5f9-8ce66e18876f%40googlegroups.com>
> >
> <https://groups.google.com/d/msgid/ansible-project/ffea2fd3-ed21-4d94-a5f9-8ce66e18876f%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ansible-project/ffea2fd3-ed21-4d94-a5f9-8ce66e18876f%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
@ej does not help !
- debug:
var:
USER: "{% if item.split('\t')[3] == 'FrontEnd' %}user1{% else %}'user2'{% endif %}" with_items: "{{ command_result.stdout_lines }}"
ERROR! 'var' is not a valid attribute for a Task
The error appears to be in '/app/axmw/Ansible/playbook/finacle_deployment/testinclude.yml.bkp': line 24, column 6, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- debug:
^ here
On Wednesday, September 25, 2019 at 4:59:45 PM UTC+5:30, ej wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3334f9fb-28f4-4155-9206-32b6a4a9ad29%40googlegroups.com.
--
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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ffea2fd3-ed21-4d94-a5f9-8ce66e18876f%40googlegroups.com.
I rest this case with the experts of this forum to suggest.