Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed cloudformation docs and updated EXAMPLES section in the docs for t... #2780

Merged
merged 1 commit into from
Apr 26, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions library/cloudformation
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,15 @@ options:
default: "yes"
choices: [ "yes", "no" ]
aliases: []
requirements: [ "boto" ]
author: James S. Martin
'''

examples:

EXAMPLES = '''
# Basic task example
tasks:
- name: launch ansible cloudformation example
cloudformation: >
action: cloudformation >
stack_name="ansible-cloudformation" state=present
region=us-east-1 disable_rollback=yes
template=files/cloudformation-example.json
Expand All @@ -82,9 +85,6 @@ examples:
DiskType: ephemeral
InstanceType: m1.small
ClusterSize: 3

requirements: [ "boto" ]
author: James S. Martin
'''

import boto.cloudformation.connection
Expand Down
36 changes: 24 additions & 12 deletions library/ec2_vol
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,34 @@ options:
required: false
default: null
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" ]
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.
# 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?).
Expand Down
19 changes: 14 additions & 5 deletions library/s3
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,24 @@ options:
required: false
default: false
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" ]
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 os
import urlparse
Expand Down