amazon ec2 - How can I limit the hosts to provision? -


i'm using vagrant create ec2 virtual machines , ansible provision them. i'm using this guide, along ec2.py script inventory.

i provisioning 1 host ansible, i've given tag named purpose (let's value "machine purpose") can in ansible file (the ec2.py script provides this):

- hosts: tag_purpose_machine_purpose 

my problem if want add server, , want provision that, can't using vagrant provision server2, because run ansible script, match first host, too, , provision 1 well.

the reason want avoid that, though ansible instructions idempotent, not of them are, unnecessarily move files etc. on node1, , more importantly, restart service running there.

is there way make ansible provision servers specify on command line?

you can limit ansible play parameter --limit. it's not documented can feed group names host names.

ansible-playbook ... --limit hosta 

also multiple hostnames separated comma possible:

ansible-playbook ... --limit hosta,hostb,hostc 

Comments

Popular posts from this blog

python 3 IndexError: list index out of range -

android - How to save instance state of selected radiobutton on menu -

IF statement in MySQL trigger -