Fixed cloudformation docs and updated EXAMPLES section in the docs for these AWS modules.
This commit is contained in:
parent
00fc43d676
commit
62a10d69a1
3 changed files with 44 additions and 23 deletions
|
@ -67,12 +67,15 @@ options:
|
||||||
default: "yes"
|
default: "yes"
|
||||||
choices: [ "yes", "no" ]
|
choices: [ "yes", "no" ]
|
||||||
aliases: []
|
aliases: []
|
||||||
|
requirements: [ "boto" ]
|
||||||
|
author: James S. Martin
|
||||||
|
'''
|
||||||
|
|
||||||
examples:
|
EXAMPLES = '''
|
||||||
|
# Basic task example
|
||||||
tasks:
|
tasks:
|
||||||
- name: launch ansible cloudformation example
|
- name: launch ansible cloudformation example
|
||||||
cloudformation: >
|
action: cloudformation >
|
||||||
stack_name="ansible-cloudformation" state=present
|
stack_name="ansible-cloudformation" state=present
|
||||||
region=us-east-1 disable_rollback=yes
|
region=us-east-1 disable_rollback=yes
|
||||||
template=files/cloudformation-example.json
|
template=files/cloudformation-example.json
|
||||||
|
@ -82,9 +85,6 @@ examples:
|
||||||
DiskType: ephemeral
|
DiskType: ephemeral
|
||||||
InstanceType: m1.small
|
InstanceType: m1.small
|
||||||
ClusterSize: 3
|
ClusterSize: 3
|
||||||
|
|
||||||
requirements: [ "boto" ]
|
|
||||||
author: James S. Martin
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
import boto.cloudformation.connection
|
import boto.cloudformation.connection
|
||||||
|
|
36
ec2_vol
36
ec2_vol
|
@ -52,22 +52,34 @@ options:
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default: null
|
||||||
aliases: []
|
aliases: []
|
||||||
examples:
|
|
||||||
- code: 'local_action: ec2_vol instance=XXXXXX volume_size=5 device_name=sdd'
|
|
||||||
description: "Simple playbook example"
|
|
||||||
- code: |
|
|
||||||
- name: Launch instances
|
|
||||||
local_action: ec2 keypair=$keypair image=$image wait=yes count=3
|
|
||||||
register: ec2
|
|
||||||
- name: Create volumes and attach
|
|
||||||
local_action: ec2_vol instance=${item.id} volume_size=5
|
|
||||||
with_items: ${ec2.instances}
|
|
||||||
register: ec2_vol
|
|
||||||
description: "Advanced - attaching multiple volumes to multiple instances"
|
|
||||||
requirements: [ "boto" ]
|
requirements: [ "boto" ]
|
||||||
author: Lester Wade
|
author: Lester Wade
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
# Simple attachment action
|
||||||
|
local_action:
|
||||||
|
module: ec2_vol
|
||||||
|
instance: XXXXXX
|
||||||
|
volume_size: 5
|
||||||
|
device_name: sdd
|
||||||
|
|
||||||
|
# Playbook example combined with instance launch
|
||||||
|
local_action:
|
||||||
|
module: ec2
|
||||||
|
keypair: $keypair
|
||||||
|
image: $image
|
||||||
|
wait: yes
|
||||||
|
count: 3
|
||||||
|
register: ec2
|
||||||
|
local_action:
|
||||||
|
module: ec2_vol
|
||||||
|
instance: ${item.id}
|
||||||
|
volume_size: 5
|
||||||
|
with_items: ${ec2.instances}
|
||||||
|
register: ec2_vol
|
||||||
|
'''
|
||||||
|
|
||||||
# Note: this module needs to be made idempotent. Possible solution is to use resource tags with the volumes.
|
# Note: this module needs to be made idempotent. Possible solution is to use resource tags with the volumes.
|
||||||
# if state=present and it doesn't exist, create, tag and attach.
|
# if state=present and it doesn't exist, create, tag and attach.
|
||||||
# Check for state by looking for volume attachment with tag (and against block device mapping?).
|
# Check for state by looking for volume attachment with tag (and against block device mapping?).
|
||||||
|
|
19
s3
19
s3
|
@ -51,15 +51,24 @@ options:
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
version_added: "1.2"
|
version_added: "1.2"
|
||||||
examples:
|
|
||||||
- code: 's3 bucket=mybucket path=/path/to/file state=present'
|
|
||||||
description: "Simple playbook example"
|
|
||||||
- code: 's3 bucket=mybucket path=/path/to/file state=present overwrite=yes'
|
|
||||||
description: "Will overwrite only if remote and local checksums do not match. Does not support files uploaded to s3 with multipart upload."
|
|
||||||
requirements: [ "boto" ]
|
requirements: [ "boto" ]
|
||||||
author: Lester Wade
|
author: Lester Wade
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
EXAMPLES = '''
|
||||||
|
# Simple PUT operation
|
||||||
|
module: s3
|
||||||
|
bucket: mybucket
|
||||||
|
path: /path/to/file
|
||||||
|
state: present
|
||||||
|
# Force and overwrite if checksums don't match
|
||||||
|
module: s3
|
||||||
|
bucket: mybucket
|
||||||
|
path: /path/to/file
|
||||||
|
state: present
|
||||||
|
overwrite: yes
|
||||||
|
'''
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import urlparse
|
import urlparse
|
||||||
|
|
Loading…
Reference in a new issue