- stat: path=/etc/.gitregister: exists_gitignore_errors: yes- lineinfile: dest=/etc/rkhunter.conf line='ALLOWHIDDENDIR="/etc/.git"' owner=root group=root mode=0644when: exists_git.stat.exists
- stat: path=/etc/.gitregister: exists_git_{{ item.name }}with_items: hostswhen: item.useApplicationignore_errors: yes- lineinfile: dest=/etc/rkhunter.conf line='ALLOWHIDDENDIR="/etc/.git"' owner=root group=root mode=0644with_items: hostswhen: item.useApplicationwhen: exists_git_{{ item.name }}.stat.exists
--
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 post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/2ced1119-8fda-4ace-a27b-db3879280f55%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You can't say "when:" twice, but you can feed it a list.
when:- item.useApplication- other_conditional
What you are doing with building a variable name in a conditional is a little weird, and this doesn't work.Rather, register when used with "with_items" will return an array, which you can easily debug:- stat: path=/etc/.gitregister: statswith_items: hostswhen: item.useApplication- debug: var=statsThough ultimately, it looks like you should drop the lineinfile and just include your logic in a template, and it will be much cleaner and easier.
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/ZP5szDnH0iI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgxWa3O298BBd6c2NqRPbQ0%3Da8PeaX8FquF7mdNin%2BgK-w%40mail.gmail.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 post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/ceb291bf-8341-4b9f-a938-5315772725d7%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/ZP5szDnH0iI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgwQ%3D7dScW-A%3DpC0%2BSZaihp8ecdY6N8ZQWEHDkeaS2ugbA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/B261AC4F-7FBC-4CE4-9BE8-FFD0E73FD3F3%40gmail.com.
- name: "domain.tld"database:name: testuser: testpw: testsystemUser: domainuseApplication: true
foreach ( hosts as item){if( item.hasApplication ) {temp = stat( item.filedir + 'myLockFile' )if( ! temp.exists) {/*** Download a Script* unzip it* move files around* Create templates ( config files ) with informations from single host* Change Owner of certain files* Create myLockFile*/}}}
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CA%2BnsWgyQxwdGumRZ1F3BNG1JW-AAQvz8YuZWqDiKqUY7AZLV3A%40mail.gmail.com.