From 7d1a006629fef2744633254577ffd6ad534432f5 Mon Sep 17 00:00:00 2001 From: Fabio Alessandro Locati Date: Mon, 5 Dec 2016 04:15:23 +0000 Subject: [PATCH] Native YAML, improve quotation (#3643) --- .../extras/cloud/amazon/route53_facts.py | 6 +++--- .../extras/cloud/centurylink/clc_aa_policy.py | 14 +++++++------ .../cloud/centurylink/clc_firewall_policy.py | 2 +- .../extras/cloud/centurylink/clc_group.py | 15 ++++++------- .../extras/cloud/centurylink/clc_publicip.py | 18 +++++++++------- .../extras/cloud/centurylink/clc_server.py | 15 +++++++------ .../modules/extras/cloud/lxd/lxd_profile.py | 4 ++-- .../extras/monitoring/circonus_annotation.py | 18 ++++++++-------- .../extras/monitoring/librato_annotation.py | 21 ++++++++++--------- .../extras/source_control/github_key.py | 6 +++--- .../extras/storage/netapp/netapp_e_auth.py | 10 ++++----- 11 files changed, 69 insertions(+), 60 deletions(-) diff --git a/lib/ansible/modules/extras/cloud/amazon/route53_facts.py b/lib/ansible/modules/extras/cloud/amazon/route53_facts.py index f42a8c364b..ff701c66ac 100644 --- a/lib/ansible/modules/extras/cloud/amazon/route53_facts.py +++ b/lib/ansible/modules/extras/cloud/amazon/route53_facts.py @@ -134,7 +134,7 @@ EXAMPLES = ''' route53_facts: profile: account_name query: record_sets - hosted_zone_id: 'ZZZ1111112222' + hosted_zone_id: ZZZ1111112222 max_items: 20 register: record_sets @@ -149,13 +149,13 @@ EXAMPLES = ''' route53_facts: query: health_check health_check_method: failure_reason - health_check_id: '00000000-1111-2222-3333-12345678abcd' + health_check_id: 00000000-1111-2222-3333-12345678abcd register: health_check_failure_reason - name: Retrieve reusable delegation set details route53_facts: query: reusable_delegation_set - delegation_set_id: 'delegation id' + delegation_set_id: delegation id register: delegation_sets ''' diff --git a/lib/ansible/modules/extras/cloud/centurylink/clc_aa_policy.py b/lib/ansible/modules/extras/cloud/centurylink/clc_aa_policy.py index 5ba0ac35b8..bf5f800fea 100644 --- a/lib/ansible/modules/extras/cloud/centurylink/clc_aa_policy.py +++ b/lib/ansible/modules/extras/cloud/centurylink/clc_aa_policy.py @@ -74,13 +74,14 @@ EXAMPLES = ''' tasks: - name: Create an Anti Affinity Policy clc_aa_policy: - name: 'Hammer Time' - location: 'UK3' + name: Hammer Time + location: UK3 state: present register: policy - name: debug - debug: var=policy + debug: + var: policy --- - name: Delete AA Policy @@ -90,13 +91,14 @@ EXAMPLES = ''' tasks: - name: Delete an Anti Affinity Policy clc_aa_policy: - name: 'Hammer Time' - location: 'UK3' + name: Hammer Time + location: UK3 state: absent register: policy - name: debug - debug: var=policy + debug: + var: policy ''' RETURN = ''' diff --git a/lib/ansible/modules/extras/cloud/centurylink/clc_firewall_policy.py b/lib/ansible/modules/extras/cloud/centurylink/clc_firewall_policy.py index c26128a40b..78a334a643 100644 --- a/lib/ansible/modules/extras/cloud/centurylink/clc_firewall_policy.py +++ b/lib/ansible/modules/extras/cloud/centurylink/clc_firewall_policy.py @@ -126,7 +126,7 @@ EXAMPLES = ''' source_account_alias: WFAD location: VA1 state: absent - firewall_policy_id: 'c62105233d7a4231bd2e91b9c791e43e1' + firewall_policy_id: c62105233d7a4231bd2e91b9c791e43e1 ''' RETURN = ''' diff --git a/lib/ansible/modules/extras/cloud/centurylink/clc_group.py b/lib/ansible/modules/extras/cloud/centurylink/clc_group.py index 07707f45f7..0794ef0c7e 100644 --- a/lib/ansible/modules/extras/cloud/centurylink/clc_group.py +++ b/lib/ansible/modules/extras/cloud/centurylink/clc_group.py @@ -83,13 +83,14 @@ EXAMPLES = ''' tasks: - name: Create / Verify a Server Group at CenturyLink Cloud clc_group: - name: 'My Cool Server Group' - parent: 'Default Group' + name: My Cool Server Group + parent: Default Group state: present register: clc - name: debug - debug: var=clc + debug: + var: clc # Delete a Server Group @@ -101,14 +102,14 @@ EXAMPLES = ''' tasks: - name: Delete / Verify Absent a Server Group at CenturyLink Cloud clc_group: - name: 'My Cool Server Group' - parent: 'Default Group' + name: My Cool Server Group + parent: Default Group state: absent register: clc - name: debug - debug: var=clc - + debug: + var: clc ''' RETURN = ''' diff --git a/lib/ansible/modules/extras/cloud/centurylink/clc_publicip.py b/lib/ansible/modules/extras/cloud/centurylink/clc_publicip.py index 10f84e56d3..8dc2be7bd5 100644 --- a/lib/ansible/modules/extras/cloud/centurylink/clc_publicip.py +++ b/lib/ansible/modules/extras/cloud/centurylink/clc_publicip.py @@ -81,17 +81,18 @@ EXAMPLES = ''' tasks: - name: Create Public IP For Servers clc_publicip: - protocol: 'TCP' + protocol: TCP ports: - - 80 + - 80 server_ids: - - UC1TEST-SVR01 - - UC1TEST-SVR02 + - UC1TEST-SVR01 + - UC1TEST-SVR02 state: present register: clc - name: debug - debug: var=clc + debug: + var: clc - name: Delete Public IP from Server hosts: localhost @@ -101,13 +102,14 @@ EXAMPLES = ''' - name: Create Public IP For Servers clc_publicip: server_ids: - - UC1TEST-SVR01 - - UC1TEST-SVR02 + - UC1TEST-SVR01 + - UC1TEST-SVR02 state: absent register: clc - name: debug - debug: var=clc + debug: + var: clc ''' RETURN = ''' diff --git a/lib/ansible/modules/extras/cloud/centurylink/clc_server.py b/lib/ansible/modules/extras/cloud/centurylink/clc_server.py index 3cb4404012..f98cd54e04 100644 --- a/lib/ansible/modules/extras/cloud/centurylink/clc_server.py +++ b/lib/ansible/modules/extras/cloud/centurylink/clc_server.py @@ -249,7 +249,7 @@ EXAMPLES = ''' name: test template: ubuntu-14-64 count: 1 - group: 'Default Group' + group: Default Group state: present - name: Ensure 'Default Group' has exactly 5 servers @@ -257,22 +257,25 @@ EXAMPLES = ''' name: test template: ubuntu-14-64 exact_count: 5 - count_group: 'Default Group' - group: 'Default Group' + count_group: Default Group + group: Default Group - name: Stop a Server clc_server: - server_ids: ['UC1ACCT-TEST01'] + server_ids: + - UC1ACCT-TEST01 state: stopped - name: Start a Server clc_server: - server_ids: ['UC1ACCT-TEST01'] + server_ids: + - UC1ACCT-TEST01 state: started - name: Delete a Server clc_server: - server_ids: ['UC1ACCT-TEST01'] + server_ids: + - UC1ACCT-TEST01 state: absent ''' diff --git a/lib/ansible/modules/extras/cloud/lxd/lxd_profile.py b/lib/ansible/modules/extras/cloud/lxd/lxd_profile.py index 272a88b174..831765bfe5 100644 --- a/lib/ansible/modules/extras/cloud/lxd/lxd_profile.py +++ b/lib/ansible/modules/extras/cloud/lxd/lxd_profile.py @@ -105,7 +105,7 @@ EXAMPLES = ''' name: macvlan state: present config: {} - description: 'my macvlan profile' + description: my macvlan profile devices: eth0: nictype: macvlan @@ -126,7 +126,7 @@ EXAMPLES = ''' name: macvlan state: present config: {} - description: 'my macvlan profile' + description: my macvlan profile devices: eth0: nictype: macvlan diff --git a/lib/ansible/modules/extras/monitoring/circonus_annotation.py b/lib/ansible/modules/extras/monitoring/circonus_annotation.py index c80c560bee..b72e43bee7 100644 --- a/lib/ansible/modules/extras/monitoring/circonus_annotation.py +++ b/lib/ansible/modules/extras/monitoring/circonus_annotation.py @@ -64,22 +64,22 @@ EXAMPLES = ''' # Create a simple annotation event with a source, defaults to start and end time of now - circonus_annotation: api_key: XXXXXXXXXXXXXXXXX - title: 'App Config Change' - description: 'This is a detailed description of the config change' - category: 'This category groups like annotations' + title: App Config Change + description: This is a detailed description of the config change + category: This category groups like annotations # Create an annotation with a duration of 5 minutes and a default start time of now - circonus_annotation: api_key: XXXXXXXXXXXXXXXXX - title: 'App Config Change' - description: 'This is a detailed description of the config change' - category: 'This category groups like annotations' + title: App Config Change + description: This is a detailed description of the config change + category: This category groups like annotations duration: 300 # Create an annotation with a start_time and end_time - circonus_annotation: api_key: XXXXXXXXXXXXXXXXX - title: 'App Config Change' - description: 'This is a detailed description of the config change' - category: 'This category groups like annotations' + title: App Config Change + description: This is a detailed description of the config change + category: This category groups like annotations start_time: 1395940006 end_time: 1395954407 ''' diff --git a/lib/ansible/modules/extras/monitoring/librato_annotation.py b/lib/ansible/modules/extras/monitoring/librato_annotation.py index f174bda0ea..d73de45983 100644 --- a/lib/ansible/modules/extras/monitoring/librato_annotation.py +++ b/lib/ansible/modules/extras/monitoring/librato_annotation.py @@ -77,27 +77,28 @@ EXAMPLES = ''' - librato_annotation: user: user@example.com api_key: XXXXXXXXXXXXXXXXX - title: 'App Config Change' - source: 'foo.bar' - description: 'This is a detailed description of the config change' + title: App Config Change + source: foo.bar + description: This is a detailed description of the config change # Create an annotation that includes a link - librato_annotation: user: user@example.com api_key: XXXXXXXXXXXXXXXXXX - name: 'code.deploy' - title: 'app code deploy' - description: 'this is a detailed description of a deployment' + name: code.deploy + title: app code deploy + description: this is a detailed description of a deployment links: - - { rel: 'example', href: 'http://www.example.com/deploy' } + - rel: example + href: http://www.example.com/deploy # Create an annotation with a start_time and end_time - librato_annotation: user: user@example.com api_key: XXXXXXXXXXXXXXXXXX - name: 'maintenance' - title: 'Maintenance window' - description: 'This is a detailed description of maintenance' + name: maintenance + title: Maintenance window + description: This is a detailed description of maintenance start_time: 1395940006 end_time: 1395954406 ''' diff --git a/lib/ansible/modules/extras/source_control/github_key.py b/lib/ansible/modules/extras/source_control/github_key.py index 9e2e2e9bd9..c27285625a 100644 --- a/lib/ansible/modules/extras/source_control/github_key.py +++ b/lib/ansible/modules/extras/source_control/github_key.py @@ -78,9 +78,9 @@ EXAMPLES = ''' - name: Authorize key with GitHub local_action: module: github_key - name: 'Access Key for Some Machine' - token: '{{github_access_token}}' - pubkey: '{{ssh_pub_key.stdout}}' + name: Access Key for Some Machine + token: '{{ github_access_token }}' + pubkey: '{{ ssh_pub_key.stdout }}' ''' diff --git a/lib/ansible/modules/extras/storage/netapp/netapp_e_auth.py b/lib/ansible/modules/extras/storage/netapp/netapp_e_auth.py index 36fd7919dc..c22de91cd1 100644 --- a/lib/ansible/modules/extras/storage/netapp/netapp_e_auth.py +++ b/lib/ansible/modules/extras/storage/netapp/netapp_e_auth.py @@ -73,12 +73,12 @@ EXAMPLES = ''' - name: Test module netapp_e_auth: name: trex - current_password: 'B4Dpwd' - new_password: 'W0rs3P4sswd' + current_password: OldPasswd + new_password: NewPasswd set_admin: yes - api_url: "{{ netapp_api_url }}" - api_username: "{{ netapp_api_username }}" - api_password: "{{ netapp_api_password }}" + api_url: '{{ netapp_api_url }}' + api_username: '{{ netapp_api_username }}' + api_password: '{{ netapp_api_password }}' ''' RETURN = '''