mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
update eucalyptus/ec2 example
This commit is contained in:
parent
264f527c98
commit
b5339fe32e
1 changed files with 3 additions and 3 deletions
|
@ -21,19 +21,19 @@
|
|||
|
||||
tasks:
|
||||
- name: Launch instance
|
||||
local_action: ec2 keypair=$keypair group=$security_group instance_type=$instance_type image=$image wait=true count=5
|
||||
local_action: ec2 keypair={{keypair}} group={{security_group}} instance_type={{instance_type}} image={{image}} wait=true count=5
|
||||
register: ec2
|
||||
|
||||
# Use with_items to add each instances public IP to a new hostgroup for use in the next play.
|
||||
|
||||
- name: Add new instances to host group
|
||||
local_action: add_host hostname=${item.public_ip} groupname=deploy
|
||||
local_action: add_host hostname={{item.public_ip}} groupname=deploy
|
||||
with_items: ${ec2.instances}
|
||||
|
||||
# Use the ec2_vol module to create volumes for attachment to each instance. Use with_items to attach to each instance (by returned id) launched previously.
|
||||
|
||||
- name: Create a volume and attach
|
||||
local_action: ec2_vol volume_size=20 instance=${item.id}
|
||||
local_action: ec2_vol volume_size=20 instance={{item.id}}
|
||||
with_items: ${ec2.instances}
|
||||
|
||||
# This play targets the new host group
|
||||
|
|
Loading…
Reference in a new issue