Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #This format takes into account the following and formats properly to connect to the instance:
- # - Using a specific private
- # - Specify the correct user
- # - Adding sshpass variable for authentication
- # - Have password protected key
- - name: add new instance to hosts
- add_host:
- hostname: "{{ item.public_ip }}"
- ansible_ssh_private_key_file: ~/.ssh/jfrap-web2
- ansible_user: "ec2-user"
- ansible_ssh_pass: "{{ sshpass }}"
- groupname: awslinux
- with_items: "{{ ec2.instances }}"
Add Comment
Please, Sign In to add comment