Multiple hosts in playbook

829 views
Skip to first unread message

vinod...@gmail.com

unread,
Jul 26, 2018, 9:24:50 AM7/26/18
to Ansible Project
HI all,

I have a playbook with 2 inventory groups. primary and secondary, where I want to run few tasks primary and few with secondary in a single playbook. How can I get that. need your help.



Brian Coca

unread,
Jul 26, 2018, 9:56:56 AM7/26/18
to Ansible Project
Playbooks contain plays, each play can target a different set of hosts, so just:

- hosts: primary
tasks:
.....

- hosts: secondary
tasks:
....



--
----------
Brian Coca

vinod...@gmail.com

unread,
Jul 26, 2018, 10:23:27 AM7/26/18
to Ansible Project
okay I got it . that's fine . but when I run this play in ansible tower, how can I get the primary and secondary host name from survey option to prompt form user to enter the hostnames. 

vinoth kumar

unread,
May 15, 2019, 6:45:45 PM5/15/19
to ansible...@googlegroups.com
Sorry for the late question. How can I make a condition that play 2 should run when play 1 is succeed 

--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CACVha7cLvS7iuwfr6kKwZVzOFPqb4UrMzX9%3DC8NNcFR2aA1YnQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages