Yes that is exactly what I was looking for Kai. Would I still specify the 
entire group 'ios' in the hosts section of the playbook?

On Wednesday, August 22, 2018 at 9:41:28 AM UTC-6, Kai Stian Olstad wrote:
>
> On 22.08.2018 17:18, Caleb Guerrero wrote: 
> > Actually after re-reading your post Brian. I can have 1 play with 
> > multiple 
> > tasks set to run_once or use a when conditional; I could also just use 
> > multiple plays to accomplish this. I was hopeful there was a way to use 
> > a 
> > for loop to loop over specific hosts running the task individually per 
> > host; however I am thinking that would make this too complex.I plan to 
> > use 
> > a role for this and break up my tasks in the tasks/main.yml file. 
>
> If I understand correctly, you would like to run the fist command on 
> fist host, the second command on the second host and so on? 
>
> If so you could do something like this 
>
>      - name: Restore base configs 
>        ios_command: 
>          commands: 
>            - command: 'configure replace {{ item.command }}' 
>              prompt: '[no]' 
>              answer: y 
>        when: intentory_hostanme == item.host 
>        with_items: 
>          - command: nvram:Til-EDC-INET_base 
>            host: Til_INET_EDC-2-WDC_7kb_Core.xxx.org 
>          - command: nvram:Til-Site-RTR-1_base 
>            host: Til-Site-RTR-1 
>            ... 
>            ... 
>            ... 
>        register: result 
>        tags: ios 
>
> -- 
> Kai Stian Olstad 
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/32ede717-fe33-4461-bf94-2352a05f6e49%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to