Host related problem

15 views
Skip to first unread message

skd...@126.com

unread,
Mar 25, 2019, 10:17:38 PM3/25/19
to Ansible Project
  Hello, 
        I just starte to use ansible, now there is a question , when during the batch execution of the playbook, some operations are performed only on one of the hosts. How do you avoid other hosts on a piaybook while performing these operations?
  For example,:
                      I will perform batch execution operations on three hosts, A,B and C, and some of them will only be executed in A. How to do this

Shankar Pentyala

unread,
Mar 25, 2019, 11:17:50 PM3/25/19
to ansible...@googlegroups.com
You can pick only one host as below example.

[webservers]
A
B
C

You can just pick host A by using 

hosts: groups[‘webservers’][0]

In your playbook.



--
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/19bfdfae-aa89-4959-af94-c71ce660c05c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

skd...@126.com

unread,
Mar 25, 2019, 11:27:32 PM3/25/19
to Ansible Project
  • Thank you. I'll try

skd...@126.com於 2019年3月26日星期二 UTC+8上午10時17分38秒寫道:

Vaibhav Singh

unread,
Mar 25, 2019, 11:44:37 PM3/25/19
to ansible...@googlegroups.com
Please check your loop properly. Possible the loop may have some logical issues.

Thanks & Regards,
Vaibhav Singh


From: ansible...@googlegroups.com <ansible...@googlegroups.com> on behalf of skd...@126.com <skd...@126.com>
Sent: Tuesday, March 26, 2019 8:57:32 AM
To: Ansible Project
Subject: [ansible-project] Re: Host related problem
 
--
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.
Reply all
Reply to author
Forward
0 new messages