[ec2-ami] make examples less verbose; fix default values in docs (#32008)

* make ec2-ami examples less verbose

* Fix default values in docs to be the actual default values

Fix default values for `architecture`, `virtualization_type` and
`wait_timeout` in docs to be the actual default values.

* Added note about examples not containing auth details
pull/32189/head
Prasad Katti 7 years ago committed by Will Thames
parent 3e0f67786f
commit 91b5a9b868

@ -42,7 +42,7 @@ options:
description: description:
- The target architecture of the image to register - The target architecture of the image to register
required: false required: false
default: null default: x86_64
kernel_id: kernel_id:
version_added: "2.3" version_added: "2.3"
description: description:
@ -54,7 +54,7 @@ options:
description: description:
- The virtualization type of the image to register - The virtualization type of the image to register
required: false required: false
default: null default: hvm
root_device_name: root_device_name:
version_added: "2.3" version_added: "2.3"
description: description:
@ -70,7 +70,7 @@ options:
wait_timeout: wait_timeout:
description: description:
- How long before wait gives up, in seconds. - How long before wait gives up, in seconds.
default: 300 default: 900
state: state:
description: description:
- Create or deregister/delete AMI. - Create or deregister/delete AMI.
@ -136,33 +136,25 @@ extends_documentation_fragment:
# Thank you to iAcquire for sponsoring development of this module. # Thank you to iAcquire for sponsoring development of this module.
EXAMPLES = ''' EXAMPLES = '''
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Basic AMI Creation # Basic AMI Creation
- ec2_ami: - ec2_ami:
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
instance_id: i-xxxxxx instance_id: i-xxxxxx
wait: yes wait: yes
name: newtest name: newtest
tags: tags:
Name: newtest Name: newtest
Service: TestService Service: TestService
register: image
# Basic AMI Creation, without waiting # Basic AMI Creation, without waiting
- ec2_ami: - ec2_ami:
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
region: xxxxxx
instance_id: i-xxxxxx instance_id: i-xxxxxx
wait: no wait: no
name: newtest name: newtest
register: image
# AMI Registration from EBS Snapshot # AMI Registration from EBS Snapshot
- ec2_ami: - ec2_ami:
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
region: xxxxxx
name: newtest name: newtest
state: present state: present
architecture: x86_64 architecture: x86_64
@ -174,12 +166,9 @@ EXAMPLES = '''
snapshot_id: snap-xxxxxxxx snapshot_id: snap-xxxxxxxx
delete_on_termination: true delete_on_termination: true
volume_type: gp2 volume_type: gp2
register: image
# AMI Creation, with a custom root-device size and another EBS attached # AMI Creation, with a custom root-device size and another EBS attached
- ec2_ami: - ec2_ami:
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
instance_id: i-xxxxxx instance_id: i-xxxxxx
name: newtest name: newtest
device_mapping: device_mapping:
@ -191,12 +180,9 @@ EXAMPLES = '''
size: YYY size: YYY
delete_on_termination: false delete_on_termination: false
volume_type: gp2 volume_type: gp2
register: image
# AMI Creation, excluding a volume attached at /dev/sdb # AMI Creation, excluding a volume attached at /dev/sdb
- ec2_ami: - ec2_ami:
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
instance_id: i-xxxxxx instance_id: i-xxxxxx
name: newtest name: newtest
device_mapping: device_mapping:
@ -206,31 +192,21 @@ EXAMPLES = '''
volume_type: gp2 volume_type: gp2
- device_name: /dev/sdb - device_name: /dev/sdb
no_device: yes no_device: yes
register: image
# Deregister/Delete AMI (keep associated snapshots) # Deregister/Delete AMI (keep associated snapshots)
- ec2_ami: - ec2_ami:
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
region: xxxxxx
image_id: "{{ instance.image_id }}" image_id: "{{ instance.image_id }}"
delete_snapshot: False delete_snapshot: False
state: absent state: absent
# Deregister AMI (delete associated snapshots too) # Deregister AMI (delete associated snapshots too)
- ec2_ami: - ec2_ami:
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
region: xxxxxx
image_id: "{{ instance.image_id }}" image_id: "{{ instance.image_id }}"
delete_snapshot: True delete_snapshot: True
state: absent state: absent
# Update AMI Launch Permissions, making it public # Update AMI Launch Permissions, making it public
- ec2_ami: - ec2_ami:
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
region: xxxxxx
image_id: "{{ instance.image_id }}" image_id: "{{ instance.image_id }}"
state: present state: present
launch_permissions: launch_permissions:
@ -238,9 +214,6 @@ EXAMPLES = '''
# Allow AMI to be launched by another account # Allow AMI to be launched by another account
- ec2_ami: - ec2_ami:
aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx
aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
region: xxxxxx
image_id: "{{ instance.image_id }}" image_id: "{{ instance.image_id }}"
state: present state: present
launch_permissions: launch_permissions:

Loading…
Cancel
Save