diff --git a/lib/ansible/modules/cloud/amazon/_ec2_ami_search.py b/lib/ansible/modules/cloud/amazon/_ec2_ami_search.py index 4e3189f5e70..eae013cc882 100644 --- a/lib/ansible/modules/cloud/amazon/_ec2_ami_search.py +++ b/lib/ansible/modules/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/lib/ansible/modules/cloud/amazon/cloudformation.py b/lib/ansible/modules/cloud/amazon/cloudformation.py index 7785998e552..c6ae0016d6d 100644 --- a/lib/ansible/modules/cloud/amazon/cloudformation.py +++ b/lib/ansible/modules/cloud/amazon/cloudformation.py @@ -152,9 +152,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 @@ -167,10 +169,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/lib/ansible/modules/cloud/amazon/ec2.py b/lib/ansible/modules/cloud/amazon/ec2.py index 0eea82e0fd8..6befcde3603 100755 --- a/lib/ansible/modules/cloud/amazon/ec2.py +++ b/lib/ansible/modules/cloud/amazon/ec2.py @@ -431,12 +431,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/lib/ansible/modules/cloud/amazon/ec2_eip.py b/lib/ansible/modules/cloud/amazon/ec2_eip.py index 3bf3c0e43f9..04e6e1e1d79 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_eip.py +++ b/lib/ansible/modules/cloud/amazon/ec2_eip.py @@ -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: diff --git a/lib/ansible/modules/cloud/amazon/ec2_facts.py b/lib/ansible/modules/cloud/amazon/ec2_facts.py index 31142b2cee5..dba3a9c7393 100644 --- a/lib/ansible/modules/cloud/amazon/ec2_facts.py +++ b/lib/ansible/modules/cloud/amazon/ec2_facts.py @@ -42,10 +42,11 @@ author: "Silviu Dicu (@silviud) " 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/lib/ansible/modules/cloud/amazon/rds.py b/lib/ansible/modules/cloud/amazon/rds.py index accf67594f0..5bd53e2d50b 100755 --- a/lib/ansible/modules/cloud/amazon/rds.py +++ b/lib/ansible/modules/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/lib/ansible/modules/cloud/amazon/route53.py b/lib/ansible/modules/cloud/amazon/route53.py index 49c1dd45065..9f23ccc4b9f 100644 --- a/lib/ansible/modules/cloud/amazon/route53.py +++ b/lib/ansible/modules/cloud/amazon/route53.py @@ -228,13 +228,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: @@ -257,14 +257,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/lib/ansible/modules/cloud/amazon/s3.py b/lib/ansible/modules/cloud/amazon/s3.py index 4362bfe8fe2..8f567a51945 100755 --- a/lib/ansible/modules/cloud/amazon/s3.py +++ b/lib/ansible/modules/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 +- name: 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 +- 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" -# Simple GET operation -- s3: bucket=mybucket object=/my/desired/key.txt dest=/usr/local/myfile.txt mode=get +- name: 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 +- 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 -# 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 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 +- 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' -# List keys simple -- s3: bucket=mybucket mode=list +- name: 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 +- name: 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 +- name: 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 +- 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 -# Delete a bucket and all contents -- s3: bucket=mybucket mode=delete +- name: 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 +- 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 -# Delete an object from a bucket -- s3: bucket=mybucket object=/my/desired/key.txt mode=delobj +- name: Delete an object from a bucket + s3: + bucket: mybucket + object: /my/desired/key.txt + mode: delobj ''' import os diff --git a/lib/ansible/modules/cloud/digital_ocean/digital_ocean.py b/lib/ansible/modules/cloud/digital_ocean/digital_ocean.py index 5dde4e19e2a..94422eb99f4 100644 --- a/lib/ansible/modules/cloud/digital_ocean/digital_ocean.py +++ b/lib/ansible/modules/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/lib/ansible/modules/cloud/docker/docker_service.py b/lib/ansible/modules/cloud/docker/docker_service.py index ad231607c09..33a31cf7679 100644 --- a/lib/ansible/modules/cloud/docker/docker_service.py +++ b/lib/ansible/modules/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/lib/ansible/modules/cloud/google/gc_storage.py b/lib/ansible/modules/cloud/google/gc_storage.py index cdf2295c76d..609dc7fe140 100644 --- a/lib/ansible/modules/cloud/google/gc_storage.py +++ b/lib/ansible/modules/cloud/google/gc_storage.py @@ -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 diff --git a/lib/ansible/modules/cloud/google/gce.py b/lib/ansible/modules/cloud/google/gce.py index b3c4916df73..0e7508f13a5 100644 --- a/lib/ansible/modules/cloud/google/gce.py +++ b/lib/ansible/modules/cloud/google/gce.py @@ -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 diff --git a/lib/ansible/modules/cloud/google/gce_mig.py b/lib/ansible/modules/cloud/google/gce_mig.py index 11433b35b20..37b17de0ba8 100644 --- a/lib/ansible/modules/cloud/google/gce_mig.py +++ b/lib/ansible/modules/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/lib/ansible/modules/cloud/openstack/_glance_image.py b/lib/ansible/modules/cloud/openstack/_glance_image.py index c6e508279ac..6be516eddde 100644 --- a/lib/ansible/modules/cloud/openstack/_glance_image.py +++ b/lib/ansible/modules/cloud/openstack/_glance_image.py @@ -117,15 +117,16 @@ requirements: ["glanceclient", "keystoneclient"] ''' 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/lib/ansible/modules/cloud/openstack/_keystone_user.py b/lib/ansible/modules/cloud/openstack/_keystone_user.py index e7be3a1d038..430e8bf40c4 100644 --- a/lib/ansible/modules/cloud/openstack/_keystone_user.py +++ b/lib/ansible/modules/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" +- name: Create a tenant + keystone_user: + tenant: demo + tenant_description: "Default Tenant" -# Create a user -- keystone_user: user=john tenant=demo password=secrete +- name: 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: Apply the admin role to the john user in the demo tenant + keystone_user: + role: admin + user: john + tenant: demo ''' try: diff --git a/lib/ansible/modules/cloud/openstack/_nova_keypair.py b/lib/ansible/modules/cloud/openstack/_nova_keypair.py index a5007141672..bc7b50cacc7 100644 --- a/lib/ansible/modules/cloud/openstack/_nova_keypair.py +++ b/lib/ansible/modules/cloud/openstack/_nova_keypair.py @@ -28,7 +28,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 @@ -80,14 +80,22 @@ options: requirements: ["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/lib/ansible/modules/cloud/openstack/_quantum_floating_ip.py b/lib/ansible/modules/cloud/openstack/_quantum_floating_ip.py index 1e24627da6e..7cfc950ca47 100644 --- a/lib/ansible/modules/cloud/openstack/_quantum_floating_ip.py +++ b/lib/ansible/modules/cloud/openstack/_quantum_floating_ip.py @@ -89,10 +89,15 @@ requirements: ["novaclient", "quantumclient", "neutronclient", "keystoneclient"] ''' 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/lib/ansible/modules/cloud/openstack/_quantum_floating_ip_associate.py b/lib/ansible/modules/cloud/openstack/_quantum_floating_ip_associate.py index c3c37dffcd5..dbae681bcb3 100644 --- a/lib/ansible/modules/cloud/openstack/_quantum_floating_ip_associate.py +++ b/lib/ansible/modules/cloud/openstack/_quantum_floating_ip_associate.py @@ -81,14 +81,14 @@ requirements: ["quantumclient", "neutronclient", "keystoneclient"] ''' 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/lib/ansible/modules/cloud/openstack/_quantum_network.py b/lib/ansible/modules/cloud/openstack/_quantum_network.py index fdd10439227..0b58a18fd11 100644 --- a/lib/ansible/modules/cloud/openstack/_quantum_network.py +++ b/lib/ansible/modules/cloud/openstack/_quantum_network.py @@ -109,15 +109,26 @@ requirements: ["quantumclient", "neutronclient", "keystoneclient"] ''' 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 +- 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 -# 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 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/lib/ansible/modules/cloud/openstack/_quantum_router.py b/lib/ansible/modules/cloud/openstack/_quantum_router.py index 61a1854073e..b7d8c26bd8c 100644 --- a/lib/ansible/modules/cloud/openstack/_quantum_router.py +++ b/lib/ansible/modules/cloud/openstack/_quantum_router.py @@ -84,12 +84,13 @@ requirements: ["quantumclient", "neutronclient", "keystoneclient"] ''' 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/lib/ansible/modules/cloud/openstack/_quantum_router_gateway.py b/lib/ansible/modules/cloud/openstack/_quantum_router_gateway.py index 90ba989e9fd..c133900cf53 100644 --- a/lib/ansible/modules/cloud/openstack/_quantum_router_gateway.py +++ b/lib/ansible/modules/cloud/openstack/_quantum_router_gateway.py @@ -78,10 +78,14 @@ requirements: ["quantumclient", "neutronclient", "keystoneclient"] ''' 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/lib/ansible/modules/cloud/openstack/_quantum_router_interface.py b/lib/ansible/modules/cloud/openstack/_quantum_router_interface.py index e6b556fa584..bac5038c6f9 100644 --- a/lib/ansible/modules/cloud/openstack/_quantum_router_interface.py +++ b/lib/ansible/modules/cloud/openstack/_quantum_router_interface.py @@ -83,13 +83,15 @@ requirements: ["quantumclient", "keystoneclient"] ''' 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/lib/ansible/modules/cloud/openstack/quantum_subnet.py b/lib/ansible/modules/cloud/openstack/quantum_subnet.py index a2db11674a5..291acccee9c 100644 --- a/lib/ansible/modules/cloud/openstack/quantum_subnet.py +++ b/lib/ansible/modules/cloud/openstack/quantum_subnet.py @@ -119,10 +119,16 @@ requirements: ["quantumclient", "neutronclient", "keystoneclient"] ''' 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/lib/ansible/modules/web_infrastructure/supervisorctl.py b/lib/ansible/modules/web_infrastructure/supervisorctl.py index bd6baa98e3b..97cd3a0c637 100644 --- a/lib/ansible/modules/web_infrastructure/supervisorctl.py +++ b/lib/ansible/modules/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' '''