Skip to content

Commit

Permalink
Include FQCN in module examples
Browse files Browse the repository at this point in the history
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
  • Loading branch information
Akasurde committed May 14, 2020
1 parent ed25a62 commit becb55f
Show file tree
Hide file tree
Showing 28 changed files with 194 additions and 213 deletions.
10 changes: 5 additions & 5 deletions plugins/modules/aws_az_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
short_description: Gather information about availability zones in AWS.
description:
- Gather information about availability zones in AWS.
- This module was called C(aws_az_facts) before Ansible 2.9. The usage did not change.
- This module was called M(amazon.aws.aws_az_facts) before Ansible 2.9. The usage did not change.
author: 'Henrique Rodrigues (@Sodki)'
options:
filters:
Expand All @@ -38,11 +38,11 @@
EXAMPLES = '''
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Gather information about all availability zones
- aws_az_info:
- name: Gather information about all availability zones
amazon.aws.aws_az_info:
# Gather information about a single availability zone
- aws_az_info:
- name: Gather information about a single availability zone
amazon.aws.aws_az_info:
filters:
zone-name: eu-west-1a
'''
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/aws_caller_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
description:
- This module returns information about the account and user / role from which the AWS access tokens originate.
- The primary use of this is to get the account id for templating into ARNs or similar to avoid needing to specify this information in inventory.
- This module was called C(aws_caller_facts) before Ansible 2.9. The usage did not change.
- This module was called M(amazon.aws.aws_caller_facts) before Ansible 2.9. The usage did not change.
author:
- Ed Costello (@orthanc)
Expand All @@ -35,7 +35,7 @@
# Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Get the current caller identity information
aws_caller_info:
amazon.aws.aws_caller_info:
register: caller_info
'''

Expand Down
26 changes: 13 additions & 13 deletions plugins/modules/aws_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,14 @@

EXAMPLES = '''
- name: Simple PUT operation
aws_s3:
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
src: /usr/local/myfile.txt
mode: put
- name: Simple PUT operation in Ceph RGW S3
aws_s3:
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
src: /usr/local/myfile.txt
Expand All @@ -170,77 +170,77 @@
s3_url: "http://localhost:8000"
- name: Simple GET operation
aws_s3:
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
dest: /usr/local/myfile.txt
mode: get
- name: Get a specific version of an object.
aws_s3:
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
version: 48c9ee5131af7a716edc22df9772aa6f
dest: /usr/local/myfile.txt
mode: get
- name: PUT/upload with metadata
aws_s3:
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
src: /usr/local/myfile.txt
mode: put
metadata: 'Content-Encoding=gzip,Cache-Control=no-cache'
- name: PUT/upload with custom headers
aws_s3:
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
src: /usr/local/myfile.txt
mode: put
headers: 'x-amz-grant-full-control=emailAddress=owner@example.com'
- name: List keys simple
aws_s3:
amazon.aws.aws_s3:
bucket: mybucket
mode: list
- name: List keys all options
aws_s3:
amazon.aws.aws_s3:
bucket: mybucket
mode: list
prefix: /my/desired/
marker: /my/desired/0023.txt
max_keys: 472
- name: Create an empty bucket
aws_s3:
amazon.aws.aws_s3:
bucket: mybucket
mode: create
permission: public-read
- name: Create a bucket with key as directory, in the EU region
aws_s3:
amazon.aws.aws_s3:
bucket: mybucket
object: /my/directory/path
mode: create
region: eu-west-1
- name: Delete a bucket and all contents
aws_s3:
amazon.aws.aws_s3:
bucket: mybucket
mode: delete
- name: GET an object but don't download if the file checksums match. New in 2.0
aws_s3:
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
dest: /usr/local/myfile.txt
mode: get
overwrite: different
- name: Delete an object from a bucket
aws_s3:
amazon.aws.aws_s3:
bucket: mybucket
object: /my/desired/key.txt
mode: delobj
Expand Down
18 changes: 9 additions & 9 deletions plugins/modules/cloudformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@

EXAMPLES = '''
- name: create a cloudformation stack
cloudformation:
amazon.aws.cloudformation:
stack_name: "ansible-cloudformation"
state: "present"
region: "us-east-1"
Expand All @@ -188,7 +188,7 @@
# Basic role example
- name: create a stack, specify role that cloudformation assumes
cloudformation:
amazon.aws.cloudformation:
stack_name: "ansible-cloudformation"
state: "present"
region: "us-east-1"
Expand All @@ -197,14 +197,14 @@
role_arn: 'arn:aws:iam::123456789012:role/cloudformation-iam-role'
- name: delete a stack
cloudformation:
amazon.aws.cloudformation:
stack_name: "ansible-cloudformation-old"
state: "absent"
# Create a stack, pass in template from a URL, disable rollback if stack creation fails,
# pass in some parameters to the template, provide tags for resources created
- name: create a stack, pass in the template via an URL
cloudformation:
amazon.aws.cloudformation:
stack_name: "ansible-cloudformation"
state: present
region: us-east-1
Expand All @@ -221,7 +221,7 @@
# Create a stack, passing in template body using lookup of Jinja2 template, disable rollback if stack creation fails,
# pass in some parameters to the template, provide tags for resources created
- name: create a stack, pass in the template body via lookup template
cloudformation:
amazon.aws.cloudformation:
stack_name: "ansible-cloudformation"
state: present
region: us-east-1
Expand All @@ -239,7 +239,7 @@
# When use_previous_value is set to True, the given value will be ignored and
# CloudFormation will use the value from a previously submitted template.
# If use_previous_value is set to False (default) the given value is used.
- cloudformation:
- amazon.aws.cloudformation:
stack_name: "ansible-cloudformation"
state: "present"
region: "us-east-1"
Expand All @@ -256,7 +256,7 @@
# Enable termination protection on a stack.
# If the stack already exists, this will update its termination protection
- name: enable termination protection during stack creation
cloudformation:
amazon.aws.cloudformation:
stack_name: my_stack
state: present
template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template
Expand All @@ -265,7 +265,7 @@
# Configure TimeoutInMinutes before the stack status becomes CREATE_FAILED
# In this case, if disable_rollback is not set or is set to false, the stack will be rolled back.
- name: enable termination protection during stack creation
cloudformation:
amazon.aws.cloudformation:
stack_name: my_stack
state: present
template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template
Expand All @@ -277,7 +277,7 @@
# In this case, if on_create_failure is set to "DELETE", it will clean up the stack if
# it fails to create
- name: create stack which will delete on creation failure
cloudformation:
amazon.aws.cloudformation:
stack_name: my_stack
state: present
template_url: https://s3.amazonaws.com/my-bucket/cloudformation.template
Expand Down
18 changes: 9 additions & 9 deletions plugins/modules/cloudformation_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
short_description: Obtain information about an AWS CloudFormation stack
description:
- Gets information about an AWS CloudFormation stack.
- This module was called C(cloudformation_facts) before Ansible 2.9, returning C(ansible_facts).
Note that the M(cloudformation_info) module no longer returns C(ansible_facts)!
- This module was called C(amazon.aws.cloudformation_facts) before Ansible 2.9, returning C(ansible_facts).
Note that the M(amazon.aws.cloudformation_info) module no longer returns C(ansible_facts)!
requirements:
- boto3 >= 1.0.0
- python >= 2.6
Expand Down Expand Up @@ -69,8 +69,8 @@
EXAMPLES = '''
# Note: These examples do not set authentication details, see the AWS Guide for details.
# Get summary information about a stack
- cloudformation_info:
- name: Get summary information about a stack
amazon.aws.cloudformation_info:
stack_name: my-cloudformation-stack
register: output
Expand All @@ -81,7 +81,7 @@
# in ansible_facts['cloudformation'][<stack_name>] and can be used as follows.
# Note that this is deprecated and will stop working in Ansible 2.13.
- cloudformation_facts:
- amazon.aws.cloudformation_facts:
stack_name: my-cloudformation-stack
- debug:
Expand All @@ -91,27 +91,27 @@
- set_fact:
stack_name: my-awesome-stack
- cloudformation_info:
- amazon.aws.cloudformation_info:
stack_name: "{{ stack_name }}"
register: my_stack
- debug:
msg: "{{ my_stack.cloudformation[stack_name].stack_outputs }}"
# Get all stack information about a stack
- cloudformation_info:
- amazon.aws.cloudformation_info:
stack_name: my-cloudformation-stack
all_facts: true
# Get stack resource and stack policy information about a stack
- cloudformation_info:
- amazon.aws.cloudformation_info:
stack_name: my-cloudformation-stack
stack_resources: true
stack_policy: true
# Fail if the stack doesn't exist
- name: try to get facts about a stack but fail if it doesn't exist
cloudformation_info:
amazon.aws.cloudformation_info:
stack_name: nonexistent-stack
all_facts: yes
failed_when: cloudformation['nonexistent-stack'] is undefined
Expand Down
Loading

0 comments on commit becb55f

Please sign in to comment.