mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -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
|
@ -96,26 +96,49 @@ author: "Benno Joy (@bennojoy)"
|
|||
'''
|
||||
|
||||
EXAMPLES = '''
|
||||
# upload some content
|
||||
- gc_storage: bucket=mybucket object=key.txt src=/usr/local/myfile.txt mode=put permission=public-read
|
||||
- name: Upload some content
|
||||
gc_storage:
|
||||
bucket: mybucket
|
||||
object: key.txt
|
||||
src: /usr/local/myfile.txt
|
||||
mode: put
|
||||
permission: public-read
|
||||
|
||||
# upload some headers
|
||||
- gc_storage: bucket=mybucket object=key.txt src=/usr/local/myfile.txt headers='{"Content-Encoding": "gzip"}'
|
||||
- name: Upload some headers
|
||||
gc_storage:
|
||||
bucket: mybucket
|
||||
object: key.txt
|
||||
src: /usr/local/myfile.txt
|
||||
headers: '{"Content-Encoding": "gzip"}'
|
||||
|
||||
# download some content
|
||||
- gc_storage: bucket=mybucket object=key.txt dest=/usr/local/myfile.txt mode=get
|
||||
- name: Download some content
|
||||
gc_storage:
|
||||
bucket: mybucket
|
||||
object: key.txt
|
||||
dest: /usr/local/myfile.txt
|
||||
mode: get
|
||||
|
||||
# Download an object as a string to use else where in your playbook
|
||||
- gc_storage: bucket=mybucket object=key.txt mode=get_str
|
||||
- name: Download an object as a string to use else where in your playbook
|
||||
gc_storage:
|
||||
bucket: mybucket
|
||||
object: key.txt
|
||||
mode: get_str
|
||||
|
||||
# Create an empty bucket
|
||||
- gc_storage: bucket=mybucket mode=create
|
||||
- name: Create an empty bucket
|
||||
gc_storage:
|
||||
bucket: mybucket
|
||||
mode: create
|
||||
|
||||
# Create a bucket with key as directory
|
||||
- gc_storage: bucket=mybucket object=/my/directory/path mode=create
|
||||
- name: Create a bucket with key as directory
|
||||
gc_storage:
|
||||
bucket: mybucket
|
||||
object: /my/directory/path
|
||||
mode: create
|
||||
|
||||
# Delete a bucket and all contents
|
||||
- gc_storage: bucket=mybucket mode=delete
|
||||
- name: Delete a bucket and all contents
|
||||
gc_storage:
|
||||
bucket: mybucket
|
||||
mode: delete
|
||||
'''
|
||||
|
||||
import os
|
||||
|
|
|
@ -258,11 +258,18 @@ EXAMPLES = '''
|
|||
register: gce
|
||||
|
||||
- name: Save host data
|
||||
add_host: hostname={{ item.public_ip }} groupname=gce_instances_ips
|
||||
add_host:
|
||||
hostname: "{{ item.public_ip }}"
|
||||
groupname: gce_instances_ips
|
||||
with_items: "{{ gce.instance_data }}"
|
||||
|
||||
- name: Wait for SSH for instances
|
||||
wait_for: delay=1 host={{ item.public_ip }} port=22 state=started timeout=30
|
||||
wait_for:
|
||||
delay: 1
|
||||
host: "{{ item.public_ip }}"
|
||||
port: 22
|
||||
state: started
|
||||
timeout: 30
|
||||
with_items: "{{ gce.instance_data }}"
|
||||
|
||||
- name: Configure Hosts
|
||||
|
|
|
@ -116,7 +116,11 @@ EXAMPLES = '''
|
|||
port: 80
|
||||
- name: foobar
|
||||
port: 82
|
||||
- pause: seconds=30
|
||||
|
||||
- name: Pause for 30 seconds
|
||||
pause:
|
||||
seconds: 30
|
||||
|
||||
- name: Recreate MIG Instances with Instance Template change.
|
||||
gce_mig:
|
||||
name: ansible-mig-example
|
||||
|
@ -124,13 +128,18 @@ EXAMPLES = '''
|
|||
state: present
|
||||
template: my-instance-template-2-small
|
||||
recreate_instances: yes
|
||||
- pause: seconds=30
|
||||
|
||||
- name: Pause for 30 seconds
|
||||
pause:
|
||||
seconds: 30
|
||||
|
||||
- name: Resize MIG
|
||||
gce_mig:
|
||||
name: ansible-mig-example
|
||||
zone: us-central1-c
|
||||
state: present
|
||||
size: 3
|
||||
|
||||
- name: Update MIG with Autoscaler
|
||||
gce_mig:
|
||||
name: ansible-mig-example
|
||||
|
@ -150,7 +159,11 @@ EXAMPLES = '''
|
|||
target: .39
|
||||
load_balancing_utilization:
|
||||
target: 0.4
|
||||
- pause: seconds=30
|
||||
|
||||
- name: Pause for 30 seconds
|
||||
pause:
|
||||
seconds: 30
|
||||
|
||||
- name: Delete MIG
|
||||
gce_mig:
|
||||
name: ansible-mig-example
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue