|
|
@ -18,9 +18,9 @@ DOCUMENTATION = '''
|
|
|
|
---
|
|
|
|
---
|
|
|
|
module: ec2_ami
|
|
|
|
module: ec2_ami
|
|
|
|
version_added: "1.3"
|
|
|
|
version_added: "1.3"
|
|
|
|
short_description: create or destroy an image in ec2, return imageid
|
|
|
|
short_description: create or destroy an image in ec2
|
|
|
|
description:
|
|
|
|
description:
|
|
|
|
- Creates or deletes ec2 images. This module has a dependency on python-boto >= 2.5
|
|
|
|
- Creates or deletes ec2 images.
|
|
|
|
options:
|
|
|
|
options:
|
|
|
|
instance_id:
|
|
|
|
instance_id:
|
|
|
|
description:
|
|
|
|
description:
|
|
|
@ -89,13 +89,10 @@ extends_documentation_fragment: aws
|
|
|
|
'''
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
|
|
# Thank you to iAcquire for sponsoring development of this module.
|
|
|
|
# Thank you to iAcquire for sponsoring development of this module.
|
|
|
|
#
|
|
|
|
|
|
|
|
# See http://alestic.com/2011/06/ec2-ami-security for more information about ensuring the security of your AMI.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EXAMPLES = '''
|
|
|
|
EXAMPLES = '''
|
|
|
|
# Basic AMI Creation
|
|
|
|
# Basic AMI Creation
|
|
|
|
- local_action:
|
|
|
|
- ec2_ami:
|
|
|
|
module: ec2_ami
|
|
|
|
|
|
|
|
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
instance_id: i-xxxxxx
|
|
|
|
instance_id: i-xxxxxx
|
|
|
@ -104,8 +101,7 @@ EXAMPLES = '''
|
|
|
|
register: instance
|
|
|
|
register: instance
|
|
|
|
|
|
|
|
|
|
|
|
# Basic AMI Creation, without waiting
|
|
|
|
# Basic AMI Creation, without waiting
|
|
|
|
- local_action:
|
|
|
|
- ec2_ami:
|
|
|
|
module: ec2_ami
|
|
|
|
|
|
|
|
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
region: xxxxxx
|
|
|
|
region: xxxxxx
|
|
|
@ -115,22 +111,20 @@ EXAMPLES = '''
|
|
|
|
register: instance
|
|
|
|
register: instance
|
|
|
|
|
|
|
|
|
|
|
|
# Deregister/Delete AMI
|
|
|
|
# Deregister/Delete AMI
|
|
|
|
- local_action:
|
|
|
|
- ec2_ami:
|
|
|
|
module: ec2_ami
|
|
|
|
|
|
|
|
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
region: xxxxxx
|
|
|
|
region: xxxxxx
|
|
|
|
image_id: ${instance.image_id}
|
|
|
|
image_id: "{{ instance.image_id }}"
|
|
|
|
delete_snapshot: True
|
|
|
|
delete_snapshot: True
|
|
|
|
state: absent
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
|
|
|
|
# Deregister AMI
|
|
|
|
# Deregister AMI
|
|
|
|
- local_action:
|
|
|
|
- ec2_ami:
|
|
|
|
module: ec2_ami
|
|
|
|
|
|
|
|
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
region: xxxxxx
|
|
|
|
region: xxxxxx
|
|
|
|
image_id: ${instance.image_id}
|
|
|
|
image_id: "{{ instance.image_id }}"
|
|
|
|
delete_snapshot: False
|
|
|
|
delete_snapshot: False
|
|
|
|
state: absent
|
|
|
|
state: absent
|
|
|
|
|
|
|
|
|
|
|
|