Skip to content

Instantly share code, notes, and snippets.

@markuman
Created September 14, 2018 09:04
Show Gist options
  • Save markuman/dadb7b400eee5d3a7345d918a1842c23 to your computer and use it in GitHub Desktop.
Save markuman/dadb7b400eee5d3a7345d918a1842c23 to your computer and use it in GitHub Desktop.
- name: Add the newly created EC2 instance(s) to the local host group (located inside the directory)
local_action: lineinfile
dest="/home/markus/ansible/inventory"
insertafter="[webserver]" line={{ item.private_ip }}
with_items: ec2_out.instances
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment