Dynamic inventory
Edit
ansible.cfg
as follows:...
inventory = ./ec2.py
...
Your playbook host must be as follows:
...
hosts: "{{ variable_host | default('tag_tfplayer_vpninstance') }}"
...
Run the playbook:
ansible-playbook playbooks/vpn.yml \
--extra-vars "variable_host=tag_tfplayer_vpninstance"
variable_host
is the EC2 instance tag. In this example the tag name is tfplayer
and the tag content is vpninstance
.Last modified 4yr ago