diff options
author | Sam Doran <sdoran@ansible.com> | 2016-11-15 16:00:33 -0500 |
---|---|---|
committer | John R Barker <john@johnrbarker.com> | 2016-11-15 21:00:33 +0000 |
commit | 52d376c88e3456535e20eb45287392bef379cc70 (patch) | |
tree | 0f98f49420027ea64b3056776853c47c7cae61ad | |
parent | 05e866e4d01e3b9c2893e0a3dbb053cb7311dcd1 (diff) | |
download | ansible-modules-core-52d376c88e3456535e20eb45287392bef379cc70.tar.gz |
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
24 files changed, 406 insertions, 188 deletions
diff --git a/cloud/amazon/_ec2_ami_search.py b/cloud/amazon/_ec2_ami_search.py index 4e3189f5..eae013cc 100644 --- a/cloud/amazon/_ec2_ami_search.py +++ b/cloud/amazon/_ec2_ami_search.py @@ -74,10 +74,18 @@ EXAMPLES = ''' connection: local tasks: - name: Get the Ubuntu precise AMI - ec2_ami_search: distro=ubuntu release=precise region=us-west-1 store=instance-store + ec2_ami_search: + distro: ubuntu + release: precise + region: us-west-1 + store: instance-store register: ubuntu_image + - name: Start the EC2 instance - ec2: image={{ ubuntu_image.ami }} instance_type=m1.small key_name=mykey + ec2: + image: "{{ ubuntu_image.ami }}" + instance_type: m1.small + key_name: mykey ''' import csv diff --git a/cloud/amazon/cloudformation.py b/cloud/amazon/cloudformation.py index f5b713e0..9d6a1b8b 100644 --- a/cloud/amazon/cloudformation.py +++ b/cloud/amazon/cloudformation.py @@ -143,9 +143,11 @@ EXAMPLES = ''' # Use a template from a URL - name: launch ansible cloudformation example cloudformation: - stack_name="ansible-cloudformation" state=present - region=us-east-1 disable_rollback=true - template_url=https://s3.amazonaws.com/my-bucket/cloudformation.template + stack_name: "ansible-cloudformation" + state: present + region: us-east-1 + disable_rollback: true + template_url: 'https://s3.amazonaws.com/my-bucket/cloudformation.template' args: template_parameters: KeyName: jmartin @@ -158,10 +160,12 @@ EXAMPLES = ''' # Use a template from a URL, and assume a role to execute - name: launch ansible cloudformation example with role assumption cloudformation: - stack_name="ansible-cloudformation" state=present - region=us-east-1 disable_rollback=true - template_url=https://s3.amazonaws.com/my-bucket/cloudformation.template - role_arn: arn:aws:iam::123456789012:role/cloudformation-iam-role + stack_name: "ansible-cloudformation" + state: present + region: us-east-1 + disable_rollback: true + template_url: 'https://s3.amazonaws.com/my-bucket/cloudformation.template' + role_arn: 'arn:aws:iam::123456789012:role/cloudformation-iam-role' args: template_parameters: KeyName: jmartin diff --git a/cloud/amazon/ec2.py b/cloud/amazon/ec2.py index 78193b18..8e17b920 100644 --- a/cloud/amazon/ec2.py +++ b/cloud/amazon/ec2.py @@ -434,12 +434,21 @@ EXAMPLES = ''' vpc_subnet_id: subnet-29e63245 assign_public_ip: yes register: ec2 + - name: Add new instance to host group - add_host: hostname={{ item.public_ip }} groupname=launched - with_items: '{{ec2.instances}}' + add_host: + hostname: "{{ item.public_ip }}" + groupname: launched + with_items: "{{ ec2.instances }}" + - name: Wait for SSH to come up - wait_for: host={{ item.public_dns_name }} port=22 delay=60 timeout=320 state=started - with_items: '{{ec2.instances}}' + wait_for: + host: "{{ item.public_dns_name }}" + port: 22 + delay: 60 + timeout: 320 + state: started + with_items: "{{ ec2.instances }}" - name: Configure instance(s) hosts: launched diff --git a/cloud/amazon/ec2_eip.py b/cloud/amazon/ec2_eip.py index 2757a618..4fb7c2ae 100644 --- a/cloud/amazon/ec2_eip.py +++ b/cloud/amazon/ec2_eip.py @@ -79,34 +79,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: diff --git a/cloud/amazon/ec2_facts.py b/cloud/amazon/ec2_facts.py index bcda99f1..f7fb86cb 100644 --- a/cloud/amazon/ec2_facts.py +++ b/cloud/amazon/ec2_facts.py @@ -42,10 +42,11 @@ author: "Silviu Dicu (@silviud) <silviudicu@gmail.com>" EXAMPLES = ''' # Conditional example - name: Gather facts - action: ec2_facts + ec2_facts: - name: Conditional - action: debug msg="This instance is a t1.micro" + debug: + msg: "This instance is a t1.micro" when: ansible_ec2_instance_type == "t1.micro" ''' diff --git a/cloud/amazon/rds.py b/cloud/amazon/rds.py index bde50fce..5b2e4383 100644 --- a/cloud/amazon/rds.py +++ b/cloud/amazon/rds.py @@ -301,9 +301,9 @@ EXAMPLES = ''' instance_name: MyNewInstanceName region: us-west-2 vpc_security_groups: sg-xxx945xx - -- debug: msg="The new db endpoint is {{ rds.instance.endpoint }}" +- debug: + msg: "The new db endpoint is {{ rds.instance.endpoint }}" ''' import sys diff --git a/cloud/amazon/route53.py b/cloud/amazon/route53.py index 6e8c2537..4f08a4f6 100644 --- a/cloud/amazon/route53.py +++ b/cloud/amazon/route53.py @@ -217,13 +217,13 @@ EXAMPLES = ''' # Add an alias record that points to an Amazon ELB: - route53: - command=create - zone=foo.com - record=elb.foo.com - type=A - value="{{ elb_dns_name }}" - alias=True - alias_hosted_zone_id="{{ elb_zone_id }}" + command: create + zone: foo.com + record: elb.foo.com + type: A + value: "{{ elb_dns_name }}" + alias: True + alias_hosted_zone_id: "{{ elb_zone_id }}" # Retrieve the details for elb.foo.com - route53: @@ -246,14 +246,14 @@ EXAMPLES = ''' # Add an alias record that points to an Amazon ELB and evaluates it health: - route53: - command=create - zone=foo.com - record=elb.foo.com - type=A - value="{{ elb_dns_name }}" - alias=True - alias_hosted_zone_id="{{ elb_zone_id }}" - alias_evaluate_target_health=True + command: create + zone: foo.com + record: elb.foo.com + type: A + value: "{{ elb_dns_name }}" + alias: True + alias_hosted_zone_id: "{{ elb_zone_id }}" + alias_evaluate_target_health: True # Add an AAAA record with Hosted Zone ID. Note that because there are colons in the value # that the entire parameter list must be quoted: diff --git a/cloud/amazon/s3.py b/cloud/amazon/s3.py index bb3d0145..bfb4627f 100755 --- a/cloud/amazon/s3.py +++ b/cloud/amazon/s3.py @@ -154,44 +154,97 @@ extends_documentation_fragment: aws ''' EXAMPLES = ''' -# Simple PUT operation -- s3: bucket=mybucket object=/my/desired/key.txt src=/usr/local/myfile.txt mode=put - -# Simple PUT operation in Ceph RGW S3 -- s3: bucket=mybucket object=/my/desired/key.txt src=/usr/local/myfile.txt mode=put rgw=true s3_url=http://localhost:8000 - -# Simple GET operation -- s3: bucket=mybucket object=/my/desired/key.txt dest=/usr/local/myfile.txt mode=get - -# Get a specific version of an object. -- s3: bucket=mybucket object=/my/desired/key.txt version=48c9ee5131af7a716edc22df9772aa6f dest=/usr/local/myfile.txt mode=get - -# PUT/upload with metadata -- s3: bucket=mybucket object=/my/desired/key.txt src=/usr/local/myfile.txt mode=put metadata='Content-Encoding=gzip,Cache-Control=no-cache' - -# PUT/upload with custom headers -- 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 - -# List keys simple -- s3: bucket=mybucket mode=list - -# List keys all options -- s3: bucket=mybucket mode=list prefix=/my/desired/ marker=/my/desired/0023.txt max_keys=472 - -# Create an empty bucket -- s3: bucket=mybucket mode=create permission=public-read - -# Create a bucket with key as directory, in the EU region -- s3: bucket=mybucket object=/my/directory/path mode=create region=eu-west-1 - -# Delete a bucket and all contents -- s3: bucket=mybucket mode=delete - -# GET an object but dont download if the file checksums match. New in 2.0 -- s3: bucket=mybucket object=/my/desired/key.txt dest=/usr/local/myfile.txt mode=get overwrite=different - -# Delete an object from a bucket -- s3: bucket=mybucket object=/my/desired/key.txt mode=delobj +- name: Simple PUT operation + s3: + bucket: mybucket + object: /my/desired/key.txt + src: /usr/local/myfile.txt + mode: put + +- name: Simple PUT operation in Ceph RGW S3 + s3: + bucket: mybucket + object: /my/desired/key.txt + src: /usr/local/myfile.txt + mode: put + rgw: true + s3_url: "http://localhost:8000" + +- name: Simple GET operation + s3: + bucket: mybucket + object: /my/desired/key.txt + dest: /usr/local/myfile.txt + mode: get + +- name: Get a specific version of an object. + s3: + bucket: mybucket + object: /my/desired/key.txt + version: 48c9ee5131af7a716edc22df9772aa6f + dest: /usr/local/myfile.txt + mode: get + +- name: PUT/upload with metadata + 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 + 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 + s3: + bucket: mybucket + mode: list + +- name: List keys all options + s3: + bucket: mybucket + mode: list + prefix: /my/desired/ + marker: /my/desired/0023.txt + max_keys: 472 + +- name: Create an empty bucket + s3: + bucket: mybucket + mode: create + permission: public-read + +- name: Create a bucket with key as directory, in the EU region + s3: + bucket: mybucket + object: /my/directory/path + mode: create + region: eu-west-1 + +- name: Delete a bucket and all contents + s3: + bucket: mybucket + mode: delete + +- name: GET an object but dont download if the file checksums match. New in 2.0 + s3: + bucket: mybucket + object: /my/desired/key.txt + dest: /usr/local/myfile.txt + mode: get + overwrite: different + +- name: Delete an object from a bucket + s3: + bucket: mybucket + object: /my/desired/key.txt + mode: delobj ''' import os diff --git a/cloud/digital_ocean/digital_ocean.py b/cloud/digital_ocean/digital_ocean.py index a90f27f7..d2c894cc 100644 --- a/cloud/digital_ocean/digital_ocean.py +++ b/cloud/digital_ocean/digital_ocean.py @@ -141,11 +141,13 @@ EXAMPLES = ''' region_id: ams2 image_id: fedora-19-x64 wait_timeout: 500 - register: my_droplet -- debug: msg="ID is {{ my_droplet.droplet.id }}" -- debug: msg="IP is {{ my_droplet.droplet.ip_address }}" +- debug: + msg: "ID is {{ my_droplet.droplet.id }}" + +- debug: + msg: "IP is {{ my_droplet.droplet.ip_address }}" # Ensure a droplet is present # If droplet id already exist, will return the droplet details and changed = False diff --git a/cloud/docker/docker_service.py b/cloud/docker/docker_service.py index ad231607..33a31cf7 100644 --- a/cloud/docker/docker_service.py +++ b/cloud/docker/docker_service.py @@ -190,14 +190,16 @@ EXAMPLES = ''' project_src: flask register: output - - debug: var=output + - debug: + var: output - docker_service: project_src: flask build: no register: output - - debug: var=output + - debug: + var: output - assert: that: "not output.changed " @@ -208,7 +210,8 @@ EXAMPLES = ''' stopped: true register: output - - debug: var=output + - debug: + var: output - assert: that: @@ -221,7 +224,8 @@ EXAMPLES = ''' restarted: true register: output - - debug: var=output + - debug: + var: output - assert: that: @@ -239,7 +243,8 @@ EXAMPLES = ''' web: 2 register: output - - debug: var=output + - debug: + var: output - name: Run with inline v2 compose hosts: localhost @@ -268,7 +273,8 @@ EXAMPLES = ''' - db register: output - - debug: var=output + - debug: + var: output - assert: that: @@ -300,7 +306,8 @@ EXAMPLES = ''' - db register: output - - debug: var=output + - debug: + var: output - assert: that: diff --git a/cloud/google/gc_storage.py b/cloud/google/gc_storage.py index 64222d47..a032c63c 100644 --- a/cloud/google/gc_storage.py +++ b/cloud/google/gc_storage.py @@ -89,26 +89,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 - -# 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 - -# 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 - -# 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: Upload some content + gc_storage: + bucket: mybucket + object: key.txt + src: /usr/local/myfile.txt + mode: put + permission: public-read + +- name: Upload some headers + gc_storage: + bucket: mybucket + object: key.txt + src: /usr/local/myfile.txt + headers: '{"Content-Encoding": "gzip"}' + +- name: Download some content + gc_storage: + bucket: mybucket + object: key.txt + dest: /usr/local/myfile.txt + mode: get + +- name: Download an object as a string to use else where in your playbook + gc_storage: + bucket: mybucket + object: key.txt + mode: get_str + +- name: Create an empty bucket + gc_storage: + bucket: mybucket + mode: create + +- name: Create a bucket with key as directory + gc_storage: + bucket: mybucket + object: /my/directory/path + mode: create + +- name: Delete a bucket and all contents + gc_storage: + bucket: mybucket + mode: delete ''' import os diff --git a/cloud/google/gce.py b/cloud/google/gce.py index 9c18b71f..7bf342bd 100644 --- a/cloud/google/gce.py +++ b/cloud/google/gce.py @@ -246,11 +246,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 diff --git a/cloud/google/gce_mig.py b/cloud/google/gce_mig.py index 11433b35..37b17de0 100644 --- a/cloud/google/gce_mig.py +++ b/cloud/google/gce_mig.py @@ -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 diff --git a/cloud/openstack/_glance_image.py b/cloud/openstack/_glance_image.py index 0db7aa2c..2d3c9583 100644 --- a/cloud/openstack/_glance_image.py +++ b/cloud/openstack/_glance_image.py @@ -120,15 +120,16 @@ requirements: ''' EXAMPLES = ''' -# Upload an image from an HTTP URL -- glance_image: login_username=admin - login_password=passme - login_tenant_name=admin - name=cirros - container_format=bare - disk_format=qcow2 - state=present - copy_from=http:launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img +- name: Upload an image from an HTTP URL + glance_image: + login_username: admin + login_password: passme + login_tenant_name: admin + name: cirros + container_format: bare + disk_format: qcow2 + state: present + copy_from: 'http://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img' ''' import time diff --git a/cloud/openstack/_keystone_user.py b/cloud/openstack/_keystone_user.py index e7be3a1d..430e8bf4 100644 --- a/cloud/openstack/_keystone_user.py +++ b/cloud/openstack/_keystone_user.py @@ -94,14 +94,22 @@ author: "Ansible Core Team (deprecated)" ''' EXAMPLES = ''' -# Create a tenant -- keystone_user: tenant=demo tenant_description="Default Tenant" - -# Create a user -- keystone_user: user=john tenant=demo password=secrete - -# Apply the admin role to the john user in the demo tenant -- keystone_user: role=admin user=john tenant=demo +- name: Create a tenant + keystone_user: + tenant: demo + tenant_description: "Default Tenant" + +- name: Create a user + keystone_user: + user: john + tenant: demo + password: secrete + +- name: Apply the admin role to the john user in the demo tenant + keystone_user: + role: admin + user: john + tenant: demo ''' try: diff --git a/cloud/openstack/_nova_keypair.py b/cloud/openstack/_nova_keypair.py index 330a280f..587bb5dc 100644 --- a/cloud/openstack/_nova_keypair.py +++ b/cloud/openstack/_nova_keypair.py @@ -29,7 +29,7 @@ DOCUMENTATION = ''' --- module: nova_keypair version_added: "1.2" -author: +author: - "Benno Joy (@bennojoy)" - "Michael DeHaan" deprecated: Deprecated in 2.0. Use os_keypair instead @@ -83,14 +83,22 @@ requirements: - "python-novaclient" ''' EXAMPLES = ''' -# Creates a key pair with the running users public key -- nova_keypair: state=present login_username=admin - login_password=admin login_tenant_name=admin name=ansible_key - public_key={{ lookup('file','~/.ssh/id_rsa.pub') }} +- name: Create a key pair with the running users public key + nova_keypair: + state: present + login_username: admin + login_password: admin + login_tenant_name: admin + name: ansible_key + public_key: "{{ lookup('file','~/.ssh/id_rsa.pub') }}" -# Creates a new key pair and the private key returned after the run. -- nova_keypair: state=present login_username=admin login_password=admin - login_tenant_name=admin name=ansible_key +- name: Create a new key pair and the private key returned after the run. + nova_keypair: + state: present + login_username: admin + login_password: admin + login_tenant_name: admin + name: ansible_key ''' def main(): diff --git a/cloud/openstack/_quantum_floating_ip.py b/cloud/openstack/_quantum_floating_ip.py index e6eb267e..d3e2c898 100644 --- a/cloud/openstack/_quantum_floating_ip.py +++ b/cloud/openstack/_quantum_floating_ip.py @@ -95,10 +95,15 @@ requirements: ''' EXAMPLES = ''' -# Assign a floating ip to the instance from an external network -- quantum_floating_ip: state=present login_username=admin login_password=admin - login_tenant_name=admin network_name=external_network - instance_name=vm1 internal_network_name=internal_network +- name: Assign a floating ip to the instance from an external network + quantum_floating_ip: + state: present + login_username: admin + login_password: admin + login_tenant_name: admin + network_name: external_network + instance_name: vm1 + internal_network_name: internal_network ''' def _get_ksclient(module, kwargs): diff --git a/cloud/openstack/_quantum_floating_ip_associate.py b/cloud/openstack/_quantum_floating_ip_associate.py index 90852974..7c7d7045 100644 --- a/cloud/openstack/_quantum_floating_ip_associate.py +++ b/cloud/openstack/_quantum_floating_ip_associate.py @@ -86,14 +86,14 @@ requirements: ''' EXAMPLES = ''' -# Associate a specific floating IP with an Instance -- quantum_floating_ip_associate: - state=present - login_username=admin - login_password=admin - login_tenant_name=admin - ip_address=1.1.1.1 - instance_name=vm1 +- name: Associate a specific floating IP with an Instance + quantum_floating_ip_associate: + state: present + login_username: admin + login_password: admin + login_tenant_name: admin + ip_address: 1.1.1.1 + instance_name: vm1 ''' def _get_ksclient(module, kwargs): diff --git a/cloud/openstack/_quantum_network.py b/cloud/openstack/_quantum_network.py index 83c80438..a6cf688e 100644 --- a/cloud/openstack/_quantum_network.py +++ b/cloud/openstack/_quantum_network.py @@ -113,15 +113,26 @@ requirements: ''' EXAMPLES = ''' -# Create a GRE backed Quantum network with tunnel id 1 for tenant1 -- quantum_network: name=t1network tenant_name=tenant1 state=present - provider_network_type=gre provider_segmentation_id=1 - login_username=admin login_password=admin login_tenant_name=admin - -# Create an external network -- quantum_network: name=external_network state=present - provider_network_type=local router_external=yes - login_username=admin login_password=admin login_tenant_name=admin +- name: Create a GRE backed Quantum network with tunnel id 1 for tenant1 + quantum_network: + name: t1network + tenant_name: tenant1 + state: present + provider_network_type: gre + provider_segmentation_id: 1 + login_username: admin + login_password: admin + login_tenant_name: admin + +- name: Create an external network + quantum_network: + name: external_network + state: present + provider_network_type: local + router_external: yes + login_username: admin + login_password: admin + login_tenant_name: admin ''' _os_keystone = None diff --git a/cloud/openstack/_quantum_router.py b/cloud/openstack/_quantum_router.py index f1e0ed8c..3a12028d 100644 --- a/cloud/openstack/_quantum_router.py +++ b/cloud/openstack/_quantum_router.py @@ -88,12 +88,13 @@ requirements: ''' EXAMPLES = ''' -# Creates a router for tenant admin -- quantum_router: state=present - login_username=admin - login_password=admin - login_tenant_name=admin - name=router1" +- name: Create a router for tenant admin + quantum_router: + state: present + login_username: admin + login_password: admin + login_tenant_name: admin + name: router1 ''' _os_keystone = None diff --git a/cloud/openstack/_quantum_router_gateway.py b/cloud/openstack/_quantum_router_gateway.py index 0e060b50..e71a1717 100644 --- a/cloud/openstack/_quantum_router_gateway.py +++ b/cloud/openstack/_quantum_router_gateway.py @@ -83,10 +83,14 @@ requirements: ''' EXAMPLES = ''' -# Attach an external network with a router to allow flow of external traffic -- quantum_router_gateway: state=present login_username=admin login_password=admin - login_tenant_name=admin router_name=external_router - network_name=external_network +- name: Attach an external network with a router to allow flow of external traffic + quantum_router_gateway: + state: present + login_username: admin + login_password: admin + login_tenant_name: admin + router_name: external_router + network_name: external_network ''' _os_keystone = None diff --git a/cloud/openstack/_quantum_router_interface.py b/cloud/openstack/_quantum_router_interface.py index abff97e0..aba6d0cb 100644 --- a/cloud/openstack/_quantum_router_interface.py +++ b/cloud/openstack/_quantum_router_interface.py @@ -88,13 +88,15 @@ requirements: ''' EXAMPLES = ''' -# Attach tenant1's subnet to the external router -- quantum_router_interface: state=present login_username=admin - login_password=admin - login_tenant_name=admin - tenant_name=tenant1 - router_name=external_route - subnet_name=t1subnet +- name: "Attach tenant1's subnet to the external router" + quantum_router_interface: + state: present + login_username: admin + login_password: admin + login_tenant_name: admin + tenant_name: tenant1 + router_name: external_route + subnet_name: t1subnet ''' diff --git a/cloud/openstack/_quantum_subnet.py b/cloud/openstack/_quantum_subnet.py index 27c2a3e8..8e6dee2c 100644 --- a/cloud/openstack/_quantum_subnet.py +++ b/cloud/openstack/_quantum_subnet.py @@ -123,10 +123,16 @@ requirements: ''' EXAMPLES = ''' -# Create a subnet for a tenant with the specified subnet -- quantum_subnet: state=present login_username=admin login_password=admin - login_tenant_name=admin tenant_name=tenant1 - network_name=network1 name=net1subnet cidr=192.168.0.0/24" +- name: Create a subnet for a tenant with the specified subnet + quantum_subnet: + state: present + login_username: admin + login_password: admin + login_tenant_name: admin + tenant_name: tenant1 + network_name: network1 + name: net1subnet + cidr: 192.168.0.0/24 ''' _os_keystone = None diff --git a/web_infrastructure/supervisorctl.py b/web_infrastructure/supervisorctl.py index bd6baa98..97cd3a0c 100644 --- a/web_infrastructure/supervisorctl.py +++ b/web_infrastructure/supervisorctl.py @@ -83,16 +83,28 @@ author: EXAMPLES = ''' # Manage the state of program to be in 'started' state. -- supervisorctl: name=my_app state=started +- supervisorctl: + name: my_app + state: started # Manage the state of program group to be in 'started' state. -- supervisorctl: name='my_apps:' state=started +- supervisorctl: + name: 'my_apps:' + state: started # Restart my_app, reading supervisorctl configuration from a specified file. -- supervisorctl: name=my_app state=restarted config=/var/opt/my_project/supervisord.conf +- supervisorctl: + name: my_app + state: restarted + config: /var/opt/my_project/supervisord.conf # Restart my_app, connecting to supervisord with credentials and server URL. -- supervisorctl: name=my_app state=restarted username=test password=testpass server_url=http://localhost:9001 +- supervisorctl: + name: my_app + state: restarted + username: test + password: testpass + server_url: 'http://localhost:9001' ''' |