Guys,
I can use boto to create instance, but my problem, i dont know how to add
tag when use it & get ip address.
If i use ansible, i can give tag name & get ip address of new instance, but
the problem the default of root size is 8GB.
How can i add my python file to create instance in ansible/ edit ec2 in
ansible?
Thx.
PS: this my python file to create instance:
#!/usr/bin/python
import boto.ec2
conn = boto.ec2.connect_to_region("ap-southeast-1",
aws_access_key_id='youraccesskey',
aws_secret_access_key='yoursecretaccesskey')
dev_sda1 = boto.ec2.blockdevicemapping.EBSBlockDeviceType()
dev_sda1.size = 150 # change root volume to 100GB instead of default 8gb
bdm = boto.ec2.blockdevicemapping.BlockDeviceMapping()
bdm['/dev/sda1'] = dev_sda1
reservation = conn.run_instances(
'ami-085b155a',
key_name='yourkeyname',
instance_type='m3.large',
security_groups=['yoursecgroupname'],
block_device_map = bdm)
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/0c5a68c7-8e26-43dd-b224-ec887f58e098%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.