Skip to content

Commit

Permalink
aws modules: fix examples to use FQCN for builtin modules/plugins (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andersson007 authored Jul 17, 2020
1 parent 059cf9e commit 92bebdd
Show file tree
Hide file tree
Showing 25 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion plugins/modules/aws_acm.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
register: cert_create
- name: print ARN of cert we just created
debug:
ansible.builtin.debug:
var: cert_create.certificate.arn
- name: delete the cert we just created
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_batch_compute_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
register: aws_batch_compute_environment_action
- name: show results
debug:
ansible.builtin.debug:
var: aws_batch_compute_environment_action
'''

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_batch_job_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
register: job_definition_create_result
- name: show results
debug: var=job_definition_create_result
ansible.builtin.debug: var=job_definition_create_result
'''

RETURN = r'''
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_batch_job_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
register: batch_job_queue_action
- name: show results
debug:
ansible.builtin.debug:
var: batch_job_queue_action
'''

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_s3_bucket_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
register: result
- name: List buckets
debug:
ansible.builtin.debug:
msg: "{{ result['buckets'] }}"
'''

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_ssm_parameter_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
overwrite_value: "always"
- name: recommend to use with aws_ssm lookup plugin
debug:
ansible.builtin.debug:
msg: "{{ lookup('amazon.aws.aws_ssm', 'hello') }}"
'''

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/cloudformation_exports_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
profile: 'my_aws_profile'
region: 'my_region'
register: cf_exports
- debug:
- ansible.builtin.debug:
msg: "{{ cf_exports }}"
'''

Expand Down
8 changes: 4 additions & 4 deletions plugins/modules/cloudfront_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@
distribution: true
distribution_id: my-cloudfront-distribution-id
register: result_did
- debug:
- ansible.builtin.debug:
msg: "{{ result_did['cloudfront']['my-cloudfront-distribution-id'] }}"
- name: Get information about a distribution using the CNAME of the cloudfront distribution.
community.aws.cloudfront_info:
distribution: true
domain_name_alias: www.my-website.com
register: result_website
- debug:
- ansible.builtin.debug:
msg: "{{ result_website['cloudfront']['www.my-website.com'] }}"
# When the module is called as cloudfront_facts, return values are published
Expand All @@ -181,13 +181,13 @@
community.aws.cloudfront_facts:
distribution: true
distribution_id: my-cloudfront-distribution-id
- debug:
- ansible.builtin.debug:
msg: "{{ ansible_facts['cloudfront']['my-cloudfront-distribution-id'] }}"
- community.aws.cloudfront_facts:
distribution: true
domain_name_alias: www.my-website.com
- debug:
- ansible.builtin.debug:
msg: "{{ ansible_facts['cloudfront']['www.my-website.com'] }}"
- name: Get all information about an invalidation for a distribution.
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/ec2_eip.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
register: eip
- name: output the IP
debug:
ansible.builtin.debug:
msg: "Allocated IP is {{ eip.public_ip }}"
- name: provision new instances with ec2
Expand All @@ -162,7 +162,7 @@
register: eip
- name: output the IP
debug:
ansible.builtin.debug:
msg: "Allocated IP inside a VPC is {{ eip.public_ip }}"
- name: allocate eip - reuse unallocated ips (if found) with FREE tag
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/ec2_eip_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
instance-id: i-123456789
register: my_vm_eips
- debug:
- ansible.builtin.debug:
msg: "{{ my_vm_eips.addresses | json_query(\"[?private_ip_address=='10.0.0.5']\") }}"
- name: List all EIP addresses for several VMs.
Expand All @@ -69,7 +69,7 @@
# Set the variable eip_alloc to the value of the first allocation_id
# and set the variable my_pub_ip to the value of the first public_ip
- set_fact:
- ansible.builtin.set_fact:
eip_alloc: my_vms_eips.addresses[0].allocation_id
my_pub_ip: my_vms_eips.addresses[0].public_ip
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/ec2_elb_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
- name: Gather information about all ELBs
community.aws.ec2_elb_info:
register: elb_info
- debug:
- ansible.builtin.debug:
msg: "{{ item.dns_name }}"
loop: "{{ elb_info.elbs }}"
Expand All @@ -56,7 +56,7 @@
names: frontend-prod-elb
register: elb_info
- debug:
- ansible.builtin.debug:
msg: "{{ elb_info.elbs.0.dns_name }}"
- name: Gather information about a set of ELBs
Expand All @@ -66,7 +66,7 @@
- backend-prod-elb
register: elb_info
- debug:
- ansible.builtin.debug:
msg: "{{ item.dns_name }}"
loop: "{{ elb_info.elbs }}"
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_lc.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
- name: Use EBS snapshot ID for volume
block:
- name: Set Volume Facts
set_fact:
ansible.builtin.set_fact:
volumes:
- device_name: /dev/sda1
volume_size: 20
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_placement_group_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
- my-other-cluster
register: specific_ec2_placement_groups
- debug:
- ansible.builtin.debug:
msg: "{{ specific_ec2_placement_groups | json_query(\"[?name=='my-cluster']\") }}"
'''
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_vpc_nat_gateway_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
register: all_ngws
- name: Debugging the result
debug:
ansible.builtin.debug:
msg: "{{ all_ngws.result }}"
- name: Get details on specific nat gateways
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_vpc_peering_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
register: all_vpc_peers
- name: Debugging the result
debug:
ansible.builtin.debug:
msg: "{{ all_vpc_peers.result }}"
- name: Get details on specific VPC peer
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/efs_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
- sg-4d3c2b1a
register: result
- debug:
- ansible.builtin.debug:
msg: "{{ result['efs'] }}"
'''

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/elb_application_lb_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
names: "alb-name"
region: "aws-region"
register: alb_info
- debug:
- ansible.builtin.debug:
var: alb_info
'''

Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/elb_classic_lb_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
- community.aws.elb_classic_lb_info:
register: elb_info
- debug:
- ansible.builtin.debug:
msg: "{{ item.dns_name }}"
loop: "{{ elb_info.elbs }}"
Expand All @@ -60,7 +60,7 @@
names: frontend-prod-elb
register: elb_info
- debug:
- ansible.builtin.debug:
msg: "{{ elb_info.elbs.0.dns_name }}"
# Gather information about a set of ELBs
Expand All @@ -70,7 +70,7 @@
- backend-prod-elb
register: elb_info
- debug:
- ansible.builtin.debug:
msg: "{{ item.dns_name }}"
loop: "{{ elb_info.elbs }}"
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/elb_target_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
register: target_info
- name: save fact for later
set_fact:
ansible.builtin.set_fact:
original_tgs: "{{ target_info.instance_target_groups }}"
- name: Deregister instance from all target groups
Expand Down Expand Up @@ -118,7 +118,7 @@
# instance - useful in case the playbook fails mid-run and manual
# rollback is required
- name: "reregistration commands: ELBv2s"
debug:
ansible.builtin.debug:
msg: >
aws --region {{ansible_ec2_placement_region}} elbv2
register-targets --target-group-arn {{item.target_group_arn}}
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/lambda_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
name: myLambdaFunction
register: lambda_info
- name: show results
debug:
ansible.builtin.debug:
msg: "{{ lambda_info['lambda_facts'] }}"
# The following will set the Dev alias to the latest version ($LATEST) since version is omitted (or = 0)
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/lambda_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
register: event
- name: Show source event
debug:
ansible.builtin.debug:
var: event.lambda_stream_events
'''

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/lambda_facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
query: all
max_items: 20
- name: show Lambda facts
debug:
ansible.builtin.debug:
var: lambda_facts
'''

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/lambda_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
max_items: 20
register: output
- name: show Lambda information
debug:
ansible.builtin.debug:
msg: "{{ output['function'] }}"
'''

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/lambda_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
register: lambda_policy_action
- name: show results
debug:
ansible.builtin.debug:
var: lambda_policy_action
'''

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/rds.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
region: us-west-2
vpc_security_groups: sg-xxx945xx
- debug:
- ansible.builtin.debug:
msg: "The new db endpoint is {{ rds.instance.endpoint }}"
'''

Expand Down

0 comments on commit 92bebdd

Please sign in to comment.