[ansible-project] ansible conditions

2018-02-01 Thread Sudhir Kumar
Hi, Below snippet sometimes working and sometimes failing. So, i am executing it with jenkins and idea is that if parameter is defined then script should run otherwise it should not run. Can anyone please enlighten me what's wrong ? # - name: Executing lvm script shell:

Re: [ansible-project] Ansible conditions and logics

2014-04-04 Thread Maxim Odinintsev
Yes, this is valid syntax and this conditions working as AND. And it working for me ;) You can create simple playbook for verifying it. I've never seen this syntax used with when: - name: Moving on debug: msg=doing something with {{ item.item }} when: - item.stat.exists == true

Re: [ansible-project] Ansible conditions and logics

2014-04-04 Thread Michael DeHaan
Correct. On Fri, Apr 4, 2014 at 8:58 AM, Maxim Odinintsev gwynn@gmail.comwrote: Yes, this is valid syntax and this conditions working as AND. And it working for me ;) You can create simple playbook for verifying it. I've never seen this syntax used with when: - name: Moving on

Re: [ansible-project] Ansible conditions and logics

2014-04-03 Thread Brian Green
I've never seen this syntax used with when: - name: Moving on debug: msg=doing something with {{ item.item }} when: - item.stat.exists == true - item.stat.islnk != true with_items: st.results Is that a valid conditional? Is it equivalent to 'and' ? On Wednesday, April 2, 2014

Re: [ansible-project] Ansible conditions and logics

2014-04-02 Thread Maxim Odinintsev
Hello, Yes, you understand correctly. How can I synchronize files on remote node (not from local host to remote) ? Thank you. If I understand correctly, you're copying the contents of several directories to a central location, removing the old path, and then creating a symlink to the new

Re: [ansible-project] Ansible conditions and logics

2014-04-02 Thread Maxim Odinintsev
Hello, I'm tried make it over ansible, but in final, i think much easiest way is using script module. If someone interesting, when i tried it, i'm used this construction for getting files attributes and states: - name: Getting files stats stat: path={{ item }} register: st with_items:

[ansible-project] Ansible conditions and logics

2014-03-31 Thread Maxim Odinintsev
Hello, I'm trying migrate out my infrastructure under ansible control, but stopped on simple things realization with ansible. I would be very grateful if some one can explain, best way for moving on this simple shell script under ansible. May be simplest way is running external shell, and not

Re: [ansible-project] Ansible conditions and logics

2014-03-31 Thread James Cammarata
If I understand correctly, you're copying the contents of several directories to a central location, removing the old path, and then creating a symlink to the new location? To do that with ansible you'd just need to call the synchronize module to copy the files (or use command/shell to do the