1 master 10 clients - run ansible playbook only on 5

0 votes
Hi guys. I have a question. I have 1 master and 10 clients in my server. In that 10cluents 5 are mine and 5 are my friends. I want to execute my playbook only in my 5 clients..

Can anyone tell me how this works??
Aug 8 in Ansible by Kumar
25 views

1 answer to this question.

0 votes

Create a group in the inventory file and mention only your 5 clients and run the playbook with --limit flag. 

[web-server]
h1
h2
h3

[servers]
s1
s2
s3
ansible-playbook --limit 'web-server' playbook.yml
answered Aug 8 by Tanya

Related Questions In Ansible

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Is it possible to run an Ansible Playbook in python script?

Hey @Cerci, Of course its possible. You ...READ MORE

answered Jan 17 in Ansible by Nicolas
2,288 views
0 votes
2 answers
+13 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 26, 2018 in DevOps & Agile by DragonLord999
• 8,380 points
180 views
0 votes
1 answer
0 votes
1 answer

Is it possible to run commands on ansible host?

If you just trying to run a ...READ MORE

answered Jan 9 in Ansible by Vijay
114 views