Last updated 6 years ago
Download ec2.py from . Save it in your Ansible root folder.
Edit ansible.cfg as follows:
ansible.cfg
... 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.
variable_host
tfplayer
vpninstance