0 votes
1 view
in Devops and Agile by (2.3k points)

So this is how my plabook looks :

---

- hosts: all

  tasks:

    - command: echo {{ item }}

      with_items: [ itemforhost1, itemforhost2]

this is what i get as the output :

TASK [command] *****************************************************************

changed: [host1] => (item=itemforhost1)

changed: [host2] => (item=itemforhost1)

changed: [host1] => (item=itemforhost2)

changed: [host2] => (item=itemforhost2)

ALl of the hosts are reading the same line, I only want my host1 to read itemforhost1 and same for host2. 

How do you think i can go about doing this? I want my output to be something like this:

TASK [command] *****************************************************************

changed: [host1] => (item=itemforhost1)

changed: [host2] => (item=itemforhost2)

Please log in or register to answer this question.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...