Re: [ansible-project] Can I combine with_items and when?

2018-02-26 Thread Nico Sabbi
OK, it's working now. Thanks! become: true become_user: root tasks: - block: #- debug: #msg: "riga {{item}}" - include_tasks: user.yml when: item | search(":") with_items: [ "abc:/home/def", "ghi:/home/jkh"] But as noted by floweryoursong... Il

Re: [ansible-project] Can I combine with_items and when?

2018-02-26 Thread Kai Stian Olstad
On Monday, 26 February 2018 15.39.09 CET Nico Sabbi wrote: > HI, > can I combine when: and with_items clauses as in this example? > > become: true > become_user: root > tasks: > - block: > - debug: > msg: "riga {{item}}" > - user: > name: "{{ item.split(':

[ansible-project] Can I combine with_items and when?

2018-02-26 Thread Nico Sabbi
HI, can I combine when: and with_items clauses as in this example? become: true become_user: root tasks: - block: - debug: msg: "riga {{item}}" - user: name: "{{ item.split(':')[0] }}" home: "{{ item.split(':')[1] }}" when: item search(":