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
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(':
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(":