mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 04:41:26 -07:00
Examples syntax batch5 (#5622)
* Change example syntax on supervisorctl module * Change example syntax or _ec2_ami_search module * Change example syntax on cloudformation module * Change example syntax on ec2 module * Change example syntax on ec2_facts module * Change example syntax on ec2_eip module * Change example syntax on rds module * Change example syntax on route53 module * Change example syntax on s3 module * Change example syntax on digital_ocean module * Change example syntax on docker_service module * Change example syntax on cloudformation module * Change example syntax on gc_storage module * Change example syntax on gce module * Change example syntax on gce_mig module * Change example syntax on _glance_image module * Change example syntax on _keystone_user module * Change example syntax on _nova_keypair module * Change example syntax on _quantum_floating module * Change example syntax on _quantum_floating_ip_associate module * Change example syntax on _quantum_network module * Change example syntax on _quantum_router module * Change example syntax on _quantum_router_gateway module * Change example syntax on _quantum_router_interface module * Change example syntax on _quantum_subnet module * SQUASH _quantum_subnet * Add missing quotes
This commit is contained in:
parent
b56a9852ee
commit
38c0769abb
24 changed files with 385 additions and 167 deletions
|
@ -85,34 +85,67 @@ notes:
|
|||
|
||||
EXAMPLES = '''
|
||||
- name: associate an elastic IP with an instance
|
||||
ec2_eip: device_id=i-1212f003 ip=93.184.216.119
|
||||
ec2_eip:
|
||||
device_id: i-1212f003
|
||||
ip: 93.184.216.119
|
||||
|
||||
- name: associate an elastic IP with a device
|
||||
ec2_eip: device_id=eni-c8ad70f3 ip=93.184.216.119
|
||||
ec2_eip:
|
||||
device_id: eni-c8ad70f3
|
||||
ip: 93.184.216.119
|
||||
|
||||
- name: disassociate an elastic IP from an instance
|
||||
ec2_eip: device_id=i-1212f003 ip=93.184.216.119 state=absent
|
||||
ec2_eip:
|
||||
device_id: i-1212f003
|
||||
ip: 93.184.216.119
|
||||
state: absent
|
||||
|
||||
- name: disassociate an elastic IP with a device
|
||||
ec2_eip: device_id=eni-c8ad70f3 ip=93.184.216.119 state=absent
|
||||
ec2_eip:
|
||||
device_id: eni-c8ad70f3
|
||||
ip: 93.184.216.119
|
||||
state: absent
|
||||
|
||||
- name: allocate a new elastic IP and associate it with an instance
|
||||
ec2_eip: device_id=i-1212f003
|
||||
ec2_eip:
|
||||
device_id: i-1212f003
|
||||
|
||||
- name: allocate a new elastic IP without associating it to anything
|
||||
action: ec2_eip
|
||||
register: eip
|
||||
|
||||
- name: output the IP
|
||||
debug: msg="Allocated IP is {{ eip.public_ip }}"
|
||||
debug:
|
||||
msg: "Allocated IP is {{ eip.public_ip }}"
|
||||
|
||||
- name: another way of allocating an elastic IP without associating it to anything
|
||||
ec2_eip: state='present'
|
||||
ec2_eip:
|
||||
state: 'present'
|
||||
|
||||
- name: provision new instances with ec2
|
||||
ec2: keypair=mykey instance_type=c1.medium image=ami-40603AD1 wait=yes'''
|
||||
''' group=webserver count=3
|
||||
ec2:
|
||||
keypair: mykey
|
||||
instance_type: c1.medium
|
||||
image: ami-40603AD1
|
||||
wait: yes
|
||||
group: webserver
|
||||
count: 3
|
||||
register: ec2
|
||||
|
||||
- name: associate new elastic IPs with each of the instances
|
||||
ec2_eip: "device_id={{ item }}"
|
||||
ec2_eip:
|
||||
device_id: "{{ item }}"
|
||||
with_items: "{{ ec2.instance_ids }}"
|
||||
|
||||
- name: allocate a new elastic IP inside a VPC in us-west-2
|
||||
ec2_eip: region=us-west-2 in_vpc=yes
|
||||
ec2_eip:
|
||||
region: us-west-2
|
||||
in_vpc: yes
|
||||
register: eip
|
||||
|
||||
- name: output the IP
|
||||
debug: msg="Allocated IP inside a VPC is {{ eip.public_ip }}"
|
||||
debug:
|
||||
msg: "Allocated IP inside a VPC is {{ eip.public_ip }}"
|
||||
'''
|
||||
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue