diff --git a/plugins/modules/gcp_bigquery_dataset.py b/plugins/modules/gcp_bigquery_dataset.py index bdba1e0..96763d7 100644 --- a/plugins/modules/gcp_bigquery_dataset.py +++ b/plugins/modules/gcp_bigquery_dataset.py @@ -148,13 +148,13 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a dataset gcp_bigquery_dataset: - name: my_example_dataset - dataset_reference: - dataset_id: my_example_dataset - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: my_example_dataset + dataset_reference: + dataset_id: my_example_dataset + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_bigquery_dataset_facts.py b/plugins/modules/gcp_bigquery_dataset_facts.py index 8c2e1e0..ab5f7f3 100644 --- a/plugins/modules/gcp_bigquery_dataset_facts.py +++ b/plugins/modules/gcp_bigquery_dataset_facts.py @@ -44,11 +44,12 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a dataset facts +- name: " a dataset facts" gcp_bigquery_dataset_facts: - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_bigquery_table.py b/plugins/modules/gcp_bigquery_table.py index 5e8c5b4..502b0b3 100644 --- a/plugins/modules/gcp_bigquery_table.py +++ b/plugins/modules/gcp_bigquery_table.py @@ -428,27 +428,27 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a dataset gcp_bigquery_dataset: - name: example_dataset - dataset_reference: - dataset_id: example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: example_dataset + dataset_reference: + dataset_id: example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: dataset - name: create a table gcp_bigquery_table: - name: example_table - dataset: example_dataset - table_reference: - dataset_id: example_dataset - project_id: "test_project" - table_id: example_table - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: example_table + dataset: example_dataset + table_reference: + dataset_id: example_dataset + project_id: test_project + table_id: example_table + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_bigquery_table_facts.py b/plugins/modules/gcp_bigquery_table_facts.py index c19ccb0..9aebcab 100644 --- a/plugins/modules/gcp_bigquery_table_facts.py +++ b/plugins/modules/gcp_bigquery_table_facts.py @@ -48,12 +48,13 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a table facts +- name: " a table facts" gcp_bigquery_table_facts: - dataset: example_dataset - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + dataset: example_dataset + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_cloudbuild_trigger.py b/plugins/modules/gcp_cloudbuild_trigger.py index c2b65b5..3183052 100644 --- a/plugins/modules/gcp_cloudbuild_trigger.py +++ b/plugins/modules/gcp_cloudbuild_trigger.py @@ -184,23 +184,23 @@ notes: EXAMPLES = ''' - name: create a repository gcp_sourcerepo_repository: - name: projects/{{ gcp_project }}/repos/{{ resource_name }} - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: projects/{{ gcp_project }}/repos/{{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present - name: create a trigger gcp_cloudbuild_trigger: - trigger_template: - branch_name: master - project_id: "test_project" - repo_name: "test_object" - filename: cloudbuild.yaml - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + trigger_template: + branch_name: master + project_id: test_project + repo_name: test_object + filename: cloudbuild.yaml + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_cloudbuild_trigger_facts.py b/plugins/modules/gcp_cloudbuild_trigger_facts.py index ee929ff..58b5b02 100644 --- a/plugins/modules/gcp_cloudbuild_trigger_facts.py +++ b/plugins/modules/gcp_cloudbuild_trigger_facts.py @@ -44,11 +44,12 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a trigger facts +- name: " a trigger facts" gcp_cloudbuild_trigger_facts: - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_address.py b/plugins/modules/gcp_compute_address.py index 6e2a6f1..1c2054a 100644 --- a/plugins/modules/gcp_compute_address.py +++ b/plugins/modules/gcp_compute_address.py @@ -121,12 +121,12 @@ notes: EXAMPLES = ''' - name: create a address gcp_compute_address: - name: test-address1 - region: us-west1 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test-address1 + region: us-west1 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_address_facts.py b/plugins/modules/gcp_compute_address_facts.py index f3ff83d..a6a3d67 100644 --- a/plugins/modules/gcp_compute_address_facts.py +++ b/plugins/modules/gcp_compute_address_facts.py @@ -56,12 +56,13 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a address facts" gcp_compute_address_facts: - region: us-west1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-west1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_backend_bucket.py b/plugins/modules/gcp_compute_backend_bucket.py index ab3f353..5fccf1a 100644 --- a/plugins/modules/gcp_compute_backend_bucket.py +++ b/plugins/modules/gcp_compute_backend_bucket.py @@ -92,14 +92,14 @@ EXAMPLES = ''' - name: create a backend bucket gcp_compute_backend_bucket: - name: "test_object" - bucket_name: "{{ bucket.name }}" - description: A BackendBucket to connect LNB w/ Storage Bucket - enable_cdn: true - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + bucket_name: "{{ bucket.name }}" + description: A BackendBucket to connect LNB w/ Storage Bucket + enable_cdn: 'true' + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_backend_bucket_facts.py b/plugins/modules/gcp_compute_backend_bucket_facts.py index bba4552..fe21d60 100644 --- a/plugins/modules/gcp_compute_backend_bucket_facts.py +++ b/plugins/modules/gcp_compute_backend_bucket_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a backend bucket facts" gcp_compute_backend_bucket_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_backend_service.py b/plugins/modules/gcp_compute_backend_service.py index d9ad236..8c2552d 100644 --- a/plugins/modules/gcp_compute_backend_service.py +++ b/plugins/modules/gcp_compute_backend_service.py @@ -328,16 +328,16 @@ EXAMPLES = ''' - name: create a backend service gcp_compute_backend_service: - name: "test_object" - backends: - - group: "{{ instancegroup }}" - health_checks: - - "{{ healthcheck.selfLink }}" - enable_cdn: true - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + backends: + - group: "{{ instancegroup }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_backend_service_facts.py b/plugins/modules/gcp_compute_backend_service_facts.py index bc84198..e9bbb3e 100644 --- a/plugins/modules/gcp_compute_backend_service_facts.py +++ b/plugins/modules/gcp_compute_backend_service_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a backend service facts" gcp_compute_backend_service_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_disk.py b/plugins/modules/gcp_compute_disk.py index 32c0729..271db2c 100644 --- a/plugins/modules/gcp_compute_disk.py +++ b/plugins/modules/gcp_compute_disk.py @@ -197,15 +197,15 @@ notes: EXAMPLES = ''' - name: create a disk gcp_compute_disk: - name: "test_object" - size_gb: 50 - disk_encryption_key: - raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= - zone: us-central1-a - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + zone: us-central1-a + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_disk_facts.py b/plugins/modules/gcp_compute_disk_facts.py index dd4236b..4cd90ee 100644 --- a/plugins/modules/gcp_compute_disk_facts.py +++ b/plugins/modules/gcp_compute_disk_facts.py @@ -55,12 +55,13 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a disk facts" gcp_compute_disk_facts: - zone: us-central1-a - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + zone: us-central1-a + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_firewall.py b/plugins/modules/gcp_compute_firewall.py index ccecb4b..98e621e 100644 --- a/plugins/modules/gcp_compute_firewall.py +++ b/plugins/modules/gcp_compute_firewall.py @@ -221,20 +221,20 @@ notes: EXAMPLES = ''' - name: create a firewall gcp_compute_firewall: - name: "test_object" - allowed: - - ip_protocol: tcp - ports: - - '22' - target_tags: - - test-ssh-server - - staging-ssh-server - source_tags: - - test-ssh-clients - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_firewall_facts.py b/plugins/modules/gcp_compute_firewall_facts.py index cfd047f..ecc39b5 100644 --- a/plugins/modules/gcp_compute_firewall_facts.py +++ b/plugins/modules/gcp_compute_firewall_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a firewall facts" gcp_compute_firewall_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_forwarding_rule.py b/plugins/modules/gcp_compute_forwarding_rule.py index d85b213..0caa9bb 100644 --- a/plugins/modules/gcp_compute_forwarding_rule.py +++ b/plugins/modules/gcp_compute_forwarding_rule.py @@ -232,16 +232,16 @@ EXAMPLES = ''' - name: create a forwarding rule gcp_compute_forwarding_rule: - name: "test_object" - region: us-west1 - target: "{{ targetpool }}" - ip_protocol: TCP - port_range: 80-80 - ip_address: "{{ address.address }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + region: us-west1 + target: "{{ targetpool }}" + ip_protocol: TCP + port_range: 80-80 + ip_address: "{{ address.address }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_forwarding_rule_facts.py b/plugins/modules/gcp_compute_forwarding_rule_facts.py index 209c05b..15cef1e 100644 --- a/plugins/modules/gcp_compute_forwarding_rule_facts.py +++ b/plugins/modules/gcp_compute_forwarding_rule_facts.py @@ -56,12 +56,13 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a forwarding rule facts" gcp_compute_forwarding_rule_facts: - region: us-west1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-west1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_global_address.py b/plugins/modules/gcp_compute_global_address.py index f597b11..9deaf15 100644 --- a/plugins/modules/gcp_compute_global_address.py +++ b/plugins/modules/gcp_compute_global_address.py @@ -95,11 +95,11 @@ notes: EXAMPLES = ''' - name: create a global address gcp_compute_global_address: - name: "test_object" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_global_address_facts.py b/plugins/modules/gcp_compute_global_address_facts.py index a73cf43..11682fe 100644 --- a/plugins/modules/gcp_compute_global_address_facts.py +++ b/plugins/modules/gcp_compute_global_address_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a global address facts" gcp_compute_global_address_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_global_forwarding_rule.py b/plugins/modules/gcp_compute_global_forwarding_rule.py index e0f489e..4f05ea2 100644 --- a/plugins/modules/gcp_compute_global_forwarding_rule.py +++ b/plugins/modules/gcp_compute_global_forwarding_rule.py @@ -254,15 +254,15 @@ EXAMPLES = ''' - name: create a global forwarding rule gcp_compute_global_forwarding_rule: - name: "test_object" - ip_address: "{{ globaladdress.address }}" - ip_protocol: TCP - port_range: 80-80 - target: "{{ httpproxy.selfLink }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + ip_address: "{{ globaladdress.address }}" + ip_protocol: TCP + port_range: 80-80 + target: "{{ httpproxy.selfLink }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_global_forwarding_rule_facts.py b/plugins/modules/gcp_compute_global_forwarding_rule_facts.py index 23ad170..a9bc165 100644 --- a/plugins/modules/gcp_compute_global_forwarding_rule_facts.py +++ b/plugins/modules/gcp_compute_global_forwarding_rule_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a global forwarding rule facts" gcp_compute_global_forwarding_rule_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_health_check.py b/plugins/modules/gcp_compute_health_check.py index 080caa2..f79e904 100644 --- a/plugins/modules/gcp_compute_health_check.py +++ b/plugins/modules/gcp_compute_health_check.py @@ -271,19 +271,19 @@ notes: EXAMPLES = ''' - name: create a health check gcp_compute_health_check: - name: "test_object" - type: TCP - tcp_health_check: - port_name: service-health - request: ping - response: pong - healthy_threshold: 10 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_health_check_facts.py b/plugins/modules/gcp_compute_health_check_facts.py index f131b0d..fd62170 100644 --- a/plugins/modules/gcp_compute_health_check_facts.py +++ b/plugins/modules/gcp_compute_health_check_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a health check facts" gcp_compute_health_check_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_http_health_check.py b/plugins/modules/gcp_compute_http_health_check.py index 6c20f3e..30cf9b3 100644 --- a/plugins/modules/gcp_compute_http_health_check.py +++ b/plugins/modules/gcp_compute_http_health_check.py @@ -112,15 +112,15 @@ notes: EXAMPLES = ''' - name: create a http health check gcp_compute_http_health_check: - name: "test_object" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_http_health_check_facts.py b/plugins/modules/gcp_compute_http_health_check_facts.py index def4aa8..a1c4fe5 100644 --- a/plugins/modules/gcp_compute_http_health_check_facts.py +++ b/plugins/modules/gcp_compute_http_health_check_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a http health check facts" gcp_compute_http_health_check_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_https_health_check.py b/plugins/modules/gcp_compute_https_health_check.py index 9d75310..da0f378 100644 --- a/plugins/modules/gcp_compute_https_health_check.py +++ b/plugins/modules/gcp_compute_https_health_check.py @@ -109,15 +109,15 @@ notes: EXAMPLES = ''' - name: create a https health check gcp_compute_https_health_check: - name: "test_object" - healthy_threshold: 10 - port: 8080 - timeout_sec: 2 - unhealthy_threshold: 5 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_https_health_check_facts.py b/plugins/modules/gcp_compute_https_health_check_facts.py index d70385d..99ca9a7 100644 --- a/plugins/modules/gcp_compute_https_health_check_facts.py +++ b/plugins/modules/gcp_compute_https_health_check_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a https health check facts" gcp_compute_https_health_check_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_image.py b/plugins/modules/gcp_compute_image.py index 7eb1624..5ecbf7b 100644 --- a/plugins/modules/gcp_compute_image.py +++ b/plugins/modules/gcp_compute_image.py @@ -210,12 +210,12 @@ EXAMPLES = ''' - name: create a image gcp_compute_image: - name: "test_object" - source_disk: "{{ disk }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + source_disk: "{{ disk }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_image_facts.py b/plugins/modules/gcp_compute_image_facts.py index 29b52df..bcf494a 100644 --- a/plugins/modules/gcp_compute_image_facts.py +++ b/plugins/modules/gcp_compute_image_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a image facts" gcp_compute_image_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_instance.py b/plugins/modules/gcp_compute_instance.py index 78ca48f..21bf960 100644 --- a/plugins/modules/gcp_compute_instance.py +++ b/plugins/modules/gcp_compute_instance.py @@ -455,26 +455,26 @@ EXAMPLES = ''' - name: create a instance gcp_compute_instance: - name: "test_object" - machine_type: n1-standard-1 - disks: - - auto_delete: true - boot: true - source: "{{ disk }}" - metadata: - startup-script-url: gs:://graphite-playground/bootstrap.sh - cost-center: '12345' - network_interfaces: - - network: "{{ network }}" - access_configs: - - name: External NAT - nat_ip: "{{ address }}" - type: ONE_TO_ONE_NAT - zone: us-central1-a - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + machine_type: n1-standard-1 + disks: + - auto_delete: 'true' + boot: 'true' + source: "{{ disk }}" + metadata: + startup-script-url: gs:://graphite-playground/bootstrap.sh + cost-center: '12345' + network_interfaces: + - network: "{{ network }}" + access_configs: + - name: External NAT + nat_ip: "{{ address }}" + type: ONE_TO_ONE_NAT + zone: us-central1-a + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_instance_facts.py b/plugins/modules/gcp_compute_instance_facts.py index 1d06ae6..dbc0431 100644 --- a/plugins/modules/gcp_compute_instance_facts.py +++ b/plugins/modules/gcp_compute_instance_facts.py @@ -55,12 +55,13 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a instance facts" gcp_compute_instance_facts: - zone: us-central1-a - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + zone: us-central1-a + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_instance_group.py b/plugins/modules/gcp_compute_instance_group.py index 7c3c787..7c7b9d7 100644 --- a/plugins/modules/gcp_compute_instance_group.py +++ b/plugins/modules/gcp_compute_instance_group.py @@ -127,16 +127,16 @@ EXAMPLES = ''' - name: create a instance group gcp_compute_instance_group: - name: "test_object" - named_ports: - - name: ansible - port: 1234 - network: "{{ network }}" - zone: us-central1-a - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + named_ports: + - name: ansible + port: 1234 + network: "{{ network }}" + zone: us-central1-a + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_instance_group_facts.py b/plugins/modules/gcp_compute_instance_group_facts.py index a8cd5b8..a875420 100644 --- a/plugins/modules/gcp_compute_instance_group_facts.py +++ b/plugins/modules/gcp_compute_instance_group_facts.py @@ -55,12 +55,13 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a instance group facts" gcp_compute_instance_group_facts: - zone: us-central1-a - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + zone: us-central1-a + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_instance_group_manager.py b/plugins/modules/gcp_compute_instance_group_manager.py index 6dfa354..2c9ef40 100644 --- a/plugins/modules/gcp_compute_instance_group_manager.py +++ b/plugins/modules/gcp_compute_instance_group_manager.py @@ -158,15 +158,15 @@ EXAMPLES = ''' - name: create a instance group manager gcp_compute_instance_group_manager: - name: "test_object" - base_instance_name: test1-child - instance_template: "{{ instancetemplate }}" - target_size: 3 - zone: us-west1-a - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + base_instance_name: test1-child + instance_template: "{{ instancetemplate }}" + target_size: 3 + zone: us-west1-a + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_instance_group_manager_facts.py b/plugins/modules/gcp_compute_instance_group_manager_facts.py index c3640ca..0d13073 100644 --- a/plugins/modules/gcp_compute_instance_group_manager_facts.py +++ b/plugins/modules/gcp_compute_instance_group_manager_facts.py @@ -55,12 +55,13 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a instance group manager facts" gcp_compute_instance_group_manager_facts: - zone: us-west1-a - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + zone: us-west1-a + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_instance_template.py b/plugins/modules/gcp_compute_instance_template.py index efba333..ee90ace 100644 --- a/plugins/modules/gcp_compute_instance_template.py +++ b/plugins/modules/gcp_compute_instance_template.py @@ -437,24 +437,24 @@ EXAMPLES = ''' - name: create a instance template gcp_compute_instance_template: - name: "test_object" - properties: - disks: - - auto_delete: true - boot: true - initialize_params: - source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts - machine_type: n1-standard-1 - network_interfaces: - - network: "{{ network }}" - access_configs: - - name: test-config - type: ONE_TO_ONE_NAT - nat_ip: "{{ address }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + properties: + disks: + - auto_delete: 'true' + boot: 'true' + initialize_params: + source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts + machine_type: n1-standard-1 + network_interfaces: + - network: "{{ network }}" + access_configs: + - name: test-config + type: ONE_TO_ONE_NAT + nat_ip: "{{ address }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_instance_template_facts.py b/plugins/modules/gcp_compute_instance_template_facts.py index e0bf1a4..b6f57d9 100644 --- a/plugins/modules/gcp_compute_instance_template_facts.py +++ b/plugins/modules/gcp_compute_instance_template_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a instance template facts" gcp_compute_instance_template_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_interconnect_attachment.py b/plugins/modules/gcp_compute_interconnect_attachment.py index f4ad618..0257551 100644 --- a/plugins/modules/gcp_compute_interconnect_attachment.py +++ b/plugins/modules/gcp_compute_interconnect_attachment.py @@ -119,14 +119,14 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a interconnect attachment gcp_compute_interconnect_attachment: - name: "test_object" - region: us-central1 - project: "test_project" - auth_kind: "serviceaccount" - interconnect: https://googleapis.com/compute/v1/projects/test_project/global/interconnects/... - router: https://googleapis.com/compute/v1/projects/test_project/regions/us-central1/routers/... - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + region: us-central1 + project: test_project + auth_kind: serviceaccount + interconnect: https://googleapis.com/compute/v1/projects/test_project/global/interconnects/... + router: https://googleapis.com/compute/v1/projects/test_project/regions/us-central1/routers/... + service_account_file: "/tmp/auth.pem" + state: present register: disk ''' diff --git a/plugins/modules/gcp_compute_interconnect_attachment_facts.py b/plugins/modules/gcp_compute_interconnect_attachment_facts.py index 0e638dc..2d43ab0 100644 --- a/plugins/modules/gcp_compute_interconnect_attachment_facts.py +++ b/plugins/modules/gcp_compute_interconnect_attachment_facts.py @@ -53,14 +53,15 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a interconnect attachment facts +- name: " a interconnect attachment facts" gcp_compute_interconnect_attachment_facts: - region: us-central1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-central1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_network.py b/plugins/modules/gcp_compute_network.py index 072c71b..5c385bc 100644 --- a/plugins/modules/gcp_compute_network.py +++ b/plugins/modules/gcp_compute_network.py @@ -113,12 +113,12 @@ notes: EXAMPLES = ''' - name: create a network gcp_compute_network: - name: "test_object" - auto_create_subnetworks: true - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + auto_create_subnetworks: 'true' + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_network_facts.py b/plugins/modules/gcp_compute_network_facts.py index 2330688..da1cbcc 100644 --- a/plugins/modules/gcp_compute_network_facts.py +++ b/plugins/modules/gcp_compute_network_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a network facts" gcp_compute_network_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_region_disk.py b/plugins/modules/gcp_compute_region_disk.py index 9ea3732..627ce87 100644 --- a/plugins/modules/gcp_compute_region_disk.py +++ b/plugins/modules/gcp_compute_region_disk.py @@ -157,18 +157,18 @@ notes: EXAMPLES = ''' - name: create a region disk gcp_compute_region_disk: - name: "test_object" - size_gb: 50 - disk_encryption_key: - raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= - region: us-central1 - replica_zones: - - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a - - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + region: us-central1 + replica_zones: + - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a + - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_region_disk_facts.py b/plugins/modules/gcp_compute_region_disk_facts.py index 8fd6202..d2f310d 100644 --- a/plugins/modules/gcp_compute_region_disk_facts.py +++ b/plugins/modules/gcp_compute_region_disk_facts.py @@ -53,14 +53,15 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a region disk facts +- name: " a region disk facts" gcp_compute_region_disk_facts: - region: us-central1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-central1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_route.py b/plugins/modules/gcp_compute_route.py index e763b4c..e0b4759 100644 --- a/plugins/modules/gcp_compute_route.py +++ b/plugins/modules/gcp_compute_route.py @@ -151,17 +151,17 @@ EXAMPLES = ''' - name: create a route gcp_compute_route: - name: "test_object" - dest_range: 192.168.6.0/24 - next_hop_gateway: global/gateways/default-internet-gateway - network: "{{ network }}" - tags: - - backends - - databases - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + dest_range: 192.168.6.0/24 + next_hop_gateway: global/gateways/default-internet-gateway + network: "{{ network }}" + tags: + - backends + - databases + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_route_facts.py b/plugins/modules/gcp_compute_route_facts.py index 2c7fdf6..34de7c0 100644 --- a/plugins/modules/gcp_compute_route_facts.py +++ b/plugins/modules/gcp_compute_route_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a route facts" gcp_compute_route_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_router.py b/plugins/modules/gcp_compute_router.py index 6ae4b5b..83ecca8 100644 --- a/plugins/modules/gcp_compute_router.py +++ b/plugins/modules/gcp_compute_router.py @@ -135,21 +135,21 @@ EXAMPLES = ''' - name: create a router gcp_compute_router: - name: "test_object" - network: "{{ network }}" - bgp: - asn: 64514 - advertise_mode: CUSTOM - advertised_groups: - - ALL_SUBNETS - advertised_ip_ranges: - - range: 1.2.3.4 - - range: 6.7.0.0/16 - region: us-central1 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + network: "{{ network }}" + bgp: + asn: 64514 + advertise_mode: CUSTOM + advertised_groups: + - ALL_SUBNETS + advertised_ip_ranges: + - range: 1.2.3.4 + - range: 6.7.0.0/16 + region: us-central1 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_router_facts.py b/plugins/modules/gcp_compute_router_facts.py index 31d50a5..45c00d8 100644 --- a/plugins/modules/gcp_compute_router_facts.py +++ b/plugins/modules/gcp_compute_router_facts.py @@ -55,12 +55,13 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a router facts" gcp_compute_router_facts: - region: us-central1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-central1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_ssl_certificate.py b/plugins/modules/gcp_compute_ssl_certificate.py index c2b2e04..8a4e6ae 100644 --- a/plugins/modules/gcp_compute_ssl_certificate.py +++ b/plugins/modules/gcp_compute_ssl_certificate.py @@ -81,36 +81,24 @@ notes: EXAMPLES = ''' - name: create a ssl certificate gcp_compute_ssl_certificate: - name: "test_object" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_ssl_certificate_facts.py b/plugins/modules/gcp_compute_ssl_certificate_facts.py index efa75d1..12c1704 100644 --- a/plugins/modules/gcp_compute_ssl_certificate_facts.py +++ b/plugins/modules/gcp_compute_ssl_certificate_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a ssl certificate facts" gcp_compute_ssl_certificate_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_ssl_policy.py b/plugins/modules/gcp_compute_ssl_policy.py index 02def51..329ec37 100644 --- a/plugins/modules/gcp_compute_ssl_policy.py +++ b/plugins/modules/gcp_compute_ssl_policy.py @@ -98,16 +98,16 @@ notes: EXAMPLES = ''' - name: create a ssl policy gcp_compute_ssl_policy: - name: "test_object" - profile: CUSTOM - min_tls_version: TLS_1_2 - custom_features: - - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 - - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + profile: CUSTOM + min_tls_version: TLS_1_2 + custom_features: + - TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_ssl_policy_facts.py b/plugins/modules/gcp_compute_ssl_policy_facts.py index 59d40ab..22758a3 100644 --- a/plugins/modules/gcp_compute_ssl_policy_facts.py +++ b/plugins/modules/gcp_compute_ssl_policy_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a ssl policy facts" gcp_compute_ssl_policy_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_subnetwork.py b/plugins/modules/gcp_compute_subnetwork.py index 648e638..5f4762a 100644 --- a/plugins/modules/gcp_compute_subnetwork.py +++ b/plugins/modules/gcp_compute_subnetwork.py @@ -150,14 +150,14 @@ EXAMPLES = ''' - name: create a subnetwork gcp_compute_subnetwork: - name: ansiblenet - region: us-west1 - network: "{{ network }}" - ip_cidr_range: 172.16.0.0/16 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: ansiblenet + region: us-west1 + network: "{{ network }}" + ip_cidr_range: 172.16.0.0/16 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_subnetwork_facts.py b/plugins/modules/gcp_compute_subnetwork_facts.py index c4c6165..9d24ddd 100644 --- a/plugins/modules/gcp_compute_subnetwork_facts.py +++ b/plugins/modules/gcp_compute_subnetwork_facts.py @@ -55,12 +55,13 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a subnetwork facts" gcp_compute_subnetwork_facts: - region: us-west1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-west1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_target_http_proxy.py b/plugins/modules/gcp_compute_target_http_proxy.py index ec91e8d..9bc3fbe 100644 --- a/plugins/modules/gcp_compute_target_http_proxy.py +++ b/plugins/modules/gcp_compute_target_http_proxy.py @@ -126,12 +126,12 @@ EXAMPLES = ''' - name: create a target http proxy gcp_compute_target_http_proxy: - name: "test_object" - url_map: "{{ urlmap }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + url_map: "{{ urlmap }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_target_http_proxy_facts.py b/plugins/modules/gcp_compute_target_http_proxy_facts.py index e10908e..1a6e68a 100644 --- a/plugins/modules/gcp_compute_target_http_proxy_facts.py +++ b/plugins/modules/gcp_compute_target_http_proxy_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a target http proxy facts" gcp_compute_target_http_proxy_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_target_https_proxy.py b/plugins/modules/gcp_compute_target_https_proxy.py index f8a145c..e849ca6 100644 --- a/plugins/modules/gcp_compute_target_https_proxy.py +++ b/plugins/modules/gcp_compute_target_https_proxy.py @@ -178,14 +178,14 @@ EXAMPLES = ''' - name: create a target https proxy gcp_compute_target_https_proxy: - name: "test_object" - ssl_certificates: - - "{{ sslcert }}" - url_map: "{{ urlmap }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_target_https_proxy_facts.py b/plugins/modules/gcp_compute_target_https_proxy_facts.py index 9507bb3..bd79ec0 100644 --- a/plugins/modules/gcp_compute_target_https_proxy_facts.py +++ b/plugins/modules/gcp_compute_target_https_proxy_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a target https proxy facts" gcp_compute_target_https_proxy_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_target_pool.py b/plugins/modules/gcp_compute_target_pool.py index 89afc77..270e1a0 100644 --- a/plugins/modules/gcp_compute_target_pool.py +++ b/plugins/modules/gcp_compute_target_pool.py @@ -135,12 +135,12 @@ notes: EXAMPLES = ''' - name: create a target pool gcp_compute_target_pool: - name: "test_object" - region: us-west1 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + region: us-west1 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_target_pool_facts.py b/plugins/modules/gcp_compute_target_pool_facts.py index f577242..48923e1 100644 --- a/plugins/modules/gcp_compute_target_pool_facts.py +++ b/plugins/modules/gcp_compute_target_pool_facts.py @@ -55,12 +55,13 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a target pool facts" gcp_compute_target_pool_facts: - region: us-west1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-west1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_target_ssl_proxy.py b/plugins/modules/gcp_compute_target_ssl_proxy.py index f0c16f7..9ce3d1a 100644 --- a/plugins/modules/gcp_compute_target_ssl_proxy.py +++ b/plugins/modules/gcp_compute_target_ssl_proxy.py @@ -167,14 +167,14 @@ EXAMPLES = ''' - name: create a target ssl proxy gcp_compute_target_ssl_proxy: - name: "test_object" - ssl_certificates: - - "{{ sslcert }}" - service: "{{ backendservice }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + ssl_certificates: + - "{{ sslcert }}" + service: "{{ backendservice }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_target_ssl_proxy_facts.py b/plugins/modules/gcp_compute_target_ssl_proxy_facts.py index 7913b90..fe582bf 100644 --- a/plugins/modules/gcp_compute_target_ssl_proxy_facts.py +++ b/plugins/modules/gcp_compute_target_ssl_proxy_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a target ssl proxy facts" gcp_compute_target_ssl_proxy_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_target_tcp_proxy.py b/plugins/modules/gcp_compute_target_tcp_proxy.py index 3f6b95a..02562ea 100644 --- a/plugins/modules/gcp_compute_target_tcp_proxy.py +++ b/plugins/modules/gcp_compute_target_tcp_proxy.py @@ -128,13 +128,13 @@ EXAMPLES = ''' - name: create a target tcp proxy gcp_compute_target_tcp_proxy: - name: "test_object" - proxy_header: PROXY_V1 - service: "{{ backendservice }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + proxy_header: PROXY_V1 + service: "{{ backendservice }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_target_tcp_proxy_facts.py b/plugins/modules/gcp_compute_target_tcp_proxy_facts.py index cc1cd86..f563a0b 100644 --- a/plugins/modules/gcp_compute_target_tcp_proxy_facts.py +++ b/plugins/modules/gcp_compute_target_tcp_proxy_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a target tcp proxy facts" gcp_compute_target_tcp_proxy_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_target_vpn_gateway.py b/plugins/modules/gcp_compute_target_vpn_gateway.py index 628c666..9bf4d8c 100644 --- a/plugins/modules/gcp_compute_target_vpn_gateway.py +++ b/plugins/modules/gcp_compute_target_vpn_gateway.py @@ -100,13 +100,13 @@ EXAMPLES = ''' - name: create a target vpn gateway gcp_compute_target_vpn_gateway: - name: "test_object" - region: us-west1 - network: "{{ network }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + region: us-west1 + network: "{{ network }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_target_vpn_gateway_facts.py b/plugins/modules/gcp_compute_target_vpn_gateway_facts.py index bc817e1..09c6913 100644 --- a/plugins/modules/gcp_compute_target_vpn_gateway_facts.py +++ b/plugins/modules/gcp_compute_target_vpn_gateway_facts.py @@ -55,12 +55,13 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a target vpn gateway facts" gcp_compute_target_vpn_gateway_facts: - region: us-west1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-west1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_url_map.py b/plugins/modules/gcp_compute_url_map.py index 642bed3..5d0c6bd 100644 --- a/plugins/modules/gcp_compute_url_map.py +++ b/plugins/modules/gcp_compute_url_map.py @@ -207,12 +207,12 @@ EXAMPLES = ''' - name: create a url map gcp_compute_url_map: - name: "test_object" - default_service: "{{ backendservice }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + default_service: "{{ backendservice }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_url_map_facts.py b/plugins/modules/gcp_compute_url_map_facts.py index 3a343c8..2fd5175 100644 --- a/plugins/modules/gcp_compute_url_map_facts.py +++ b/plugins/modules/gcp_compute_url_map_facts.py @@ -51,11 +51,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a url map facts" gcp_compute_url_map_facts: - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_vpn_tunnel.py b/plugins/modules/gcp_compute_vpn_tunnel.py index b01e884..18c6519 100644 --- a/plugins/modules/gcp_compute_vpn_tunnel.py +++ b/plugins/modules/gcp_compute_vpn_tunnel.py @@ -123,54 +123,54 @@ notes: EXAMPLES = ''' - name: create a network gcp_compute_network: - name: "network-vpn-tunnel" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: network-vpn-tunnel + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: network - name: create a router gcp_compute_router: - name: "router-vpn-tunnel" - network: "{{ network }}" - bgp: - asn: 64514 - advertise_mode: CUSTOM - advertised_groups: - - ALL_SUBNETS - advertised_ip_ranges: - - range: 1.2.3.4 - - range: 6.7.0.0/16 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: router-vpn-tunnel + network: "{{ network }}" + bgp: + asn: 64514 + advertise_mode: CUSTOM + advertised_groups: + - ALL_SUBNETS + advertised_ip_ranges: + - range: 1.2.3.4 + - range: 6.7.0.0/16 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: router - name: create a target vpn gateway gcp_compute_target_vpn_gateway: - name: "gateway-vpn-tunnel" - region: us-west1 - network: "{{ network }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: gateway-vpn-tunnel + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: gateway - name: create a vpn tunnel gcp_compute_vpn_tunnel: - name: "test_object" - region: us-west1 - target_vpn_gateway: "{{ gateway }}" - router: "{{ router }}" - shared_secret: super secret - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + region: us-west1 + target_vpn_gateway: "{{ gateway }}" + router: "{{ router }}" + shared_secret: super secret + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_compute_vpn_tunnel_facts.py b/plugins/modules/gcp_compute_vpn_tunnel_facts.py index 6571f8b..da4b071 100644 --- a/plugins/modules/gcp_compute_vpn_tunnel_facts.py +++ b/plugins/modules/gcp_compute_vpn_tunnel_facts.py @@ -55,12 +55,13 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: " a vpn tunnel facts" gcp_compute_vpn_tunnel_facts: - region: us-west1 - filters: - - name = test_object - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-west1 + filters: + - name = test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_container_cluster.py b/plugins/modules/gcp_container_cluster.py index 92ed4a9..3a55ab9 100644 --- a/plugins/modules/gcp_container_cluster.py +++ b/plugins/modules/gcp_container_cluster.py @@ -265,19 +265,19 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a cluster gcp_container_cluster: - name: my-cluster - initial_node_count: 2 - master_auth: - username: cluster_admin - password: my-secret-password - node_config: - machine_type: n1-standard-4 - disk_size_gb: 500 - location: us-central1-a - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: my-cluster + initial_node_count: 2 + master_auth: + username: cluster_admin + password: my-secret-password + node_config: + machine_type: n1-standard-4 + disk_size_gb: 500 + location: us-central1-a + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_container_cluster_facts.py b/plugins/modules/gcp_container_cluster_facts.py index 67fe06f..119fa71 100644 --- a/plugins/modules/gcp_container_cluster_facts.py +++ b/plugins/modules/gcp_container_cluster_facts.py @@ -52,12 +52,13 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a cluster facts +- name: " a cluster facts" gcp_container_cluster_facts: - location: us-central1-a - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + location: us-central1-a + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_container_node_pool.py b/plugins/modules/gcp_container_node_pool.py index fd27c78..e0cf122 100644 --- a/plugins/modules/gcp_container_node_pool.py +++ b/plugins/modules/gcp_container_node_pool.py @@ -221,25 +221,25 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a cluster gcp_container_cluster: - name: "cluster-nodepool" - initial_node_count: 4 - location: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: cluster-nodepool + initial_node_count: 4 + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: cluster - name: create a node pool gcp_container_node_pool: - name: my-pool - initial_node_count: 4 - cluster: "{{ cluster }}" - location: us-central1-a - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: my-pool + initial_node_count: 4 + cluster: "{{ cluster }}" + location: us-central1-a + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_container_node_pool_facts.py b/plugins/modules/gcp_container_node_pool_facts.py index 33d4593..a95501e 100644 --- a/plugins/modules/gcp_container_node_pool_facts.py +++ b/plugins/modules/gcp_container_node_pool_facts.py @@ -60,13 +60,14 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a node pool facts +- name: " a node pool facts" gcp_container_node_pool_facts: - cluster: "{{ cluster }}" - location: us-central1-a - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + cluster: "{{ cluster }}" + location: us-central1-a + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_dns_managed_zone.py b/plugins/modules/gcp_dns_managed_zone.py index 8146a84..71566ea 100644 --- a/plugins/modules/gcp_dns_managed_zone.py +++ b/plugins/modules/gcp_dns_managed_zone.py @@ -82,13 +82,13 @@ notes: EXAMPLES = ''' - name: create a managed zone gcp_dns_managed_zone: - name: "test_object" - dns_name: test.somewild2.example.com. - description: test zone - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + dns_name: test.somewild2.example.com. + description: test zone + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_dns_managed_zone_facts.py b/plugins/modules/gcp_dns_managed_zone_facts.py index 8a7b675..9a5f73a 100644 --- a/plugins/modules/gcp_dns_managed_zone_facts.py +++ b/plugins/modules/gcp_dns_managed_zone_facts.py @@ -47,12 +47,13 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a managed zone facts +- name: " a managed zone facts" gcp_dns_managed_zone_facts: - dns_name: test.somewild2.example.com. - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + dns_name: test.somewild2.example.com. + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_dns_resource_record_set.py b/plugins/modules/gcp_dns_resource_record_set.py index a603a8b..d9a9725 100644 --- a/plugins/modules/gcp_dns_resource_record_set.py +++ b/plugins/modules/gcp_dns_resource_record_set.py @@ -106,17 +106,17 @@ EXAMPLES = ''' - name: create a resource record set gcp_dns_resource_record_set: - name: www.testzone-4.com. - managed_zone: "{{ managed_zone }}" - type: A - ttl: 600 - target: - - 10.1.2.3 - - 40.5.6.7 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: www.testzone-4.com. + managed_zone: "{{ managed_zone }}" + type: A + ttl: 600 + target: + - 10.1.2.3 + - 40.5.6.7 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_dns_resource_record_set_facts.py b/plugins/modules/gcp_dns_resource_record_set_facts.py index c84edfe..402cc4d 100644 --- a/plugins/modules/gcp_dns_resource_record_set_facts.py +++ b/plugins/modules/gcp_dns_resource_record_set_facts.py @@ -52,12 +52,13 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a resource record set facts +- name: " a resource record set facts" gcp_dns_resource_record_set_facts: - managed_zone: "{{ managed_zone }}" - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + managed_zone: "{{ managed_zone }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_iam_role.py b/plugins/modules/gcp_iam_role.py index 532dadf..a9e8a85 100644 --- a/plugins/modules/gcp_iam_role.py +++ b/plugins/modules/gcp_iam_role.py @@ -81,17 +81,17 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a role gcp_iam_role: - name: myCustomRole2 - title: My Custom Role - description: My custom role description - included_permissions: - - iam.roles.list - - iam.roles.create - - iam.roles.delete - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: myCustomRole2 + title: My Custom Role + description: My custom role description + included_permissions: + - iam.roles.list + - iam.roles.create + - iam.roles.delete + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_iam_role_facts.py b/plugins/modules/gcp_iam_role_facts.py index 08da273..9e24ebd 100644 --- a/plugins/modules/gcp_iam_role_facts.py +++ b/plugins/modules/gcp_iam_role_facts.py @@ -44,11 +44,12 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a role facts +- name: " a role facts" gcp_iam_role_facts: - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_iam_service_account.py b/plugins/modules/gcp_iam_service_account.py index e7b6ddc..0411719 100644 --- a/plugins/modules/gcp_iam_service_account.py +++ b/plugins/modules/gcp_iam_service_account.py @@ -61,14 +61,12 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a service account gcp_iam_service_account: - name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" - - ' - display_name: My Ansible test key - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com"' + display_name: My Ansible test key + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_iam_service_account_facts.py b/plugins/modules/gcp_iam_service_account_facts.py index 062fc57..151423a 100644 --- a/plugins/modules/gcp_iam_service_account_facts.py +++ b/plugins/modules/gcp_iam_service_account_facts.py @@ -44,11 +44,12 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a service account facts +- name: " a service account facts" gcp_iam_service_account_facts: - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_iam_service_account_key.py b/plugins/modules/gcp_iam_service_account_key.py index daaa3d6..50d8ee0 100644 --- a/plugins/modules/gcp_iam_service_account_key.py +++ b/plugins/modules/gcp_iam_service_account_key.py @@ -83,23 +83,23 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a service account gcp_iam_service_account: - name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com - display_name: My Ansible test key - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com + display_name: My Ansible test key + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: serviceaccount - name: create a service account key gcp_iam_service_account_key: - service_account: "{{ serviceaccount }}" - private_key_type: TYPE_GOOGLE_CREDENTIALS_FILE - path: "~/test_account.json" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + service_account: "{{ serviceaccount }}" + private_key_type: TYPE_GOOGLE_CREDENTIALS_FILE + path: "~/test_account.json" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_pubsub_subscription.py b/plugins/modules/gcp_pubsub_subscription.py index 016a204..fd93b87 100644 --- a/plugins/modules/gcp_pubsub_subscription.py +++ b/plugins/modules/gcp_pubsub_subscription.py @@ -131,13 +131,13 @@ EXAMPLES = ''' - name: create a subscription gcp_pubsub_subscription: - name: "test_object" - topic: "{{ topic }}" - ack_deadline_seconds: 300 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + topic: "{{ topic }}" + ack_deadline_seconds: 300 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_pubsub_subscription_facts.py b/plugins/modules/gcp_pubsub_subscription_facts.py index 5917598..c9850fe 100644 --- a/plugins/modules/gcp_pubsub_subscription_facts.py +++ b/plugins/modules/gcp_pubsub_subscription_facts.py @@ -44,11 +44,12 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a subscription facts +- name: " a subscription facts" gcp_pubsub_subscription_facts: - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_pubsub_topic.py b/plugins/modules/gcp_pubsub_topic.py index 3c6f4b0..5982ed0 100644 --- a/plugins/modules/gcp_pubsub_topic.py +++ b/plugins/modules/gcp_pubsub_topic.py @@ -65,11 +65,11 @@ notes: EXAMPLES = ''' - name: create a topic gcp_pubsub_topic: - name: test-topic1 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test-topic1 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_pubsub_topic_facts.py b/plugins/modules/gcp_pubsub_topic_facts.py index 0cbc746..466d8a6 100644 --- a/plugins/modules/gcp_pubsub_topic_facts.py +++ b/plugins/modules/gcp_pubsub_topic_facts.py @@ -44,11 +44,12 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a topic facts +- name: " a topic facts" gcp_pubsub_topic_facts: - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_redis_instance.py b/plugins/modules/gcp_redis_instance.py index bec3b2a..6dfcfdf 100644 --- a/plugins/modules/gcp_redis_instance.py +++ b/plugins/modules/gcp_redis_instance.py @@ -123,30 +123,30 @@ notes: EXAMPLES = ''' - name: create a network gcp_compute_network: - name: "network-instance" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: network-instance + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: network - name: create a instance gcp_redis_instance: - name: instance37 - tier: STANDARD_HA - memory_size_gb: 1 - region: us-central1 - location_id: us-central1-a - redis_version: REDIS_3_2 - display_name: Ansible Test Instance - reserved_ip_range: 192.168.0.0/29 - labels: - my_key: my_val - other_key: other_val - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: instance37 + tier: STANDARD_HA + memory_size_gb: 1 + region: us-central1 + location_id: us-central1-a + redis_version: REDIS_3_2 + display_name: Ansible Test Instance + reserved_ip_range: 192.168.0.0/29 + labels: + my_key: my_val + other_key: other_val + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_redis_instance_facts.py b/plugins/modules/gcp_redis_instance_facts.py index 6a00cf4..bfdf4fe 100644 --- a/plugins/modules/gcp_redis_instance_facts.py +++ b/plugins/modules/gcp_redis_instance_facts.py @@ -48,12 +48,13 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a instance facts +- name: " a instance facts" gcp_redis_instance_facts: - region: us-central1 - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + region: us-central1 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_resourcemanager_project.py b/plugins/modules/gcp_resourcemanager_project.py index 71bcc35..5418514 100644 --- a/plugins/modules/gcp_resourcemanager_project.py +++ b/plugins/modules/gcp_resourcemanager_project.py @@ -90,14 +90,14 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a project gcp_resourcemanager_project: - name: My Sample Project - id: alextest-{{ 10000000000 | random }} - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - parent: - type: organization - id: 636173955921 - state: present + name: My Sample Project + id: alextest-{{ 10000000000 | random }} + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + parent: + type: organization + id: 636173955921 + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_resourcemanager_project_facts.py b/plugins/modules/gcp_resourcemanager_project_facts.py index b5e787e..8f4be97 100644 --- a/plugins/modules/gcp_resourcemanager_project_facts.py +++ b/plugins/modules/gcp_resourcemanager_project_facts.py @@ -44,11 +44,12 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a project facts +- name: " a project facts" gcp_resourcemanager_project_facts: - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_sourcerepo_repository.py b/plugins/modules/gcp_sourcerepo_repository.py index 43cb36e..d1e1a06 100644 --- a/plugins/modules/gcp_sourcerepo_repository.py +++ b/plugins/modules/gcp_sourcerepo_repository.py @@ -62,11 +62,11 @@ notes: EXAMPLES = ''' - name: create a repository gcp_sourcerepo_repository: - name: projects/test_project/repos/test_object - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: projects/test_project/repos/test_object + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_sourcerepo_repository_facts.py b/plugins/modules/gcp_sourcerepo_repository_facts.py index cdf028f..e6c3a9a 100644 --- a/plugins/modules/gcp_sourcerepo_repository_facts.py +++ b/plugins/modules/gcp_sourcerepo_repository_facts.py @@ -44,11 +44,12 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a repository facts +- name: " a repository facts" gcp_sourcerepo_repository_facts: - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_spanner_database.py b/plugins/modules/gcp_spanner_database.py index b633a4d..e9d852e 100644 --- a/plugins/modules/gcp_spanner_database.py +++ b/plugins/modules/gcp_spanner_database.py @@ -90,12 +90,12 @@ EXAMPLES = ''' - name: create a database gcp_spanner_database: - name: webstore - instance: "{{ instance }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: webstore + instance: "{{ instance }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_spanner_database_facts.py b/plugins/modules/gcp_spanner_database_facts.py index 07deedf..23d4f29 100644 --- a/plugins/modules/gcp_spanner_database_facts.py +++ b/plugins/modules/gcp_spanner_database_facts.py @@ -52,12 +52,13 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a database facts +- name: " a database facts" gcp_spanner_database_facts: - instance: "{{ instance }}" - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + instance: "{{ instance }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_spanner_instance.py b/plugins/modules/gcp_spanner_instance.py index 8a118cc..ed2cf44 100644 --- a/plugins/modules/gcp_spanner_instance.py +++ b/plugins/modules/gcp_spanner_instance.py @@ -85,16 +85,16 @@ notes: EXAMPLES = ''' - name: create a instance gcp_spanner_instance: - name: testinstance - display_name: My Spanner Instance - node_count: 2 - labels: - cost_center: ti-1700004 - config: regional-us-central1 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: testinstance + display_name: My Spanner Instance + node_count: 2 + labels: + cost_center: ti-1700004 + config: regional-us-central1 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_spanner_instance_facts.py b/plugins/modules/gcp_spanner_instance_facts.py index 918bfae..c1c5d40 100644 --- a/plugins/modules/gcp_spanner_instance_facts.py +++ b/plugins/modules/gcp_spanner_instance_facts.py @@ -44,11 +44,12 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a instance facts +- name: " a instance facts" gcp_spanner_instance_facts: - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_sql_database.py b/plugins/modules/gcp_sql_database.py index fb970d2..ca3e421 100644 --- a/plugins/modules/gcp_sql_database.py +++ b/plugins/modules/gcp_sql_database.py @@ -74,29 +74,29 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a instance gcp_sql_instance: - name: "{{resource_name}}-3" - settings: - ip_configuration: - authorized_networks: - - name: google dns server - value: 8.8.8.8/32 - tier: db-n1-standard-1 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{resource_name}}-3" + settings: + ip_configuration: + authorized_networks: + - name: google dns server + value: 8.8.8.8/32 + tier: db-n1-standard-1 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instance - name: create a database gcp_sql_database: - name: "test_object" - charset: utf8 - instance: "{{ instance }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test_object + charset: utf8 + instance: "{{ instance }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_sql_database_facts.py b/plugins/modules/gcp_sql_database_facts.py index b1b4305..df677e0 100644 --- a/plugins/modules/gcp_sql_database_facts.py +++ b/plugins/modules/gcp_sql_database_facts.py @@ -52,12 +52,13 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a database facts +- name: " a database facts" gcp_sql_database_facts: - instance: "{{ instance }}" - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + instance: "{{ instance }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_sql_instance.py b/plugins/modules/gcp_sql_instance.py index 5252317..f1fd075 100644 --- a/plugins/modules/gcp_sql_instance.py +++ b/plugins/modules/gcp_sql_instance.py @@ -299,18 +299,18 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a instance gcp_sql_instance: - name: "{{resource_name}}-2" - settings: - ip_configuration: - authorized_networks: - - name: google dns server - value: 8.8.8.8/32 - tier: db-n1-standard-1 - region: us-central1 - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: "{{resource_name}}-2" + settings: + ip_configuration: + authorized_networks: + - name: google dns server + value: 8.8.8.8/32 + tier: db-n1-standard-1 + region: us-central1 + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_sql_instance_facts.py b/plugins/modules/gcp_sql_instance_facts.py index f921083..9f1b9ce 100644 --- a/plugins/modules/gcp_sql_instance_facts.py +++ b/plugins/modules/gcp_sql_instance_facts.py @@ -44,11 +44,12 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a instance facts +- name: " a instance facts" gcp_sql_instance_facts: - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_sql_user.py b/plugins/modules/gcp_sql_user.py index e1d6d94..9699a4e 100644 --- a/plugins/modules/gcp_sql_user.py +++ b/plugins/modules/gcp_sql_user.py @@ -75,30 +75,30 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a instance gcp_sql_instance: - name: "{{resource_name}}-1" - settings: - ip_configuration: - authorized_networks: - - name: google dns server - value: 8.8.8.8/32 - tier: db-n1-standard-1 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{resource_name}}-1" + settings: + ip_configuration: + authorized_networks: + - name: google dns server + value: 8.8.8.8/32 + tier: db-n1-standard-1 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instance - name: create a user gcp_sql_user: - name: test-user - host: 10.1.2.3 - password: secret-password - instance: "{{ instance }}" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: test-user + host: 10.1.2.3 + password: secret-password + instance: "{{ instance }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_sql_user_facts.py b/plugins/modules/gcp_sql_user_facts.py index 22692b6..9511a87 100644 --- a/plugins/modules/gcp_sql_user_facts.py +++ b/plugins/modules/gcp_sql_user_facts.py @@ -52,12 +52,13 @@ extends_documentation_fragment: gcp ''' EXAMPLES = ''' -- name: a user facts +- name: " a user facts" gcp_sql_user_facts: - instance: "{{ instance }}" - project: test_project - auth_kind: serviceaccount - service_account_file: "/tmp/auth.pem" + instance: "{{ instance }}" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: facts ''' RETURN = ''' diff --git a/plugins/modules/gcp_storage_bucket.py b/plugins/modules/gcp_storage_bucket.py index 691b216..0da5659 100644 --- a/plugins/modules/gcp_storage_bucket.py +++ b/plugins/modules/gcp_storage_bucket.py @@ -394,11 +394,11 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a bucket gcp_storage_bucket: - name: ansible-storage-module - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: ansible-storage-module + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_storage_bucket_access_control.py b/plugins/modules/gcp_storage_bucket_access_control.py index 5bfa359..8e25f11 100644 --- a/plugins/modules/gcp_storage_bucket_access_control.py +++ b/plugins/modules/gcp_storage_bucket_access_control.py @@ -108,22 +108,22 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a bucket gcp_storage_bucket: - name: "{{ resource_name }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: bucket - name: create a bucket access control gcp_storage_bucket_access_control: - bucket: "test_object" - entity: user-alexstephen@google.com - role: WRITER - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + bucket: test_object + entity: user-alexstephen@google.com + role: WRITER + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/plugins/modules/gcp_storage_object.py b/plugins/modules/gcp_storage_object.py index f589a36..756b201 100644 --- a/plugins/modules/gcp_storage_object.py +++ b/plugins/modules/gcp_storage_object.py @@ -78,15 +78,15 @@ extends_documentation_fragment: gcp EXAMPLES = ''' - name: create a object gcp_storage_object: - name: ansible-storage-module - action: download - bucket: ansible-bucket - src: modules.zip - dest: "~/modules.zip" - project: "test_project" - auth_kind: "serviceaccount" - service_account_file: "/tmp/auth.pem" - state: present + name: ansible-storage-module + action: download + bucket: ansible-bucket + src: modules.zip + dest: "~/modules.zip" + project: test_project + auth_kind: serviceaccount + service_account_file: "/tmp/auth.pem" + state: present ''' RETURN = ''' diff --git a/tests/integration/gcp_bigquery_dataset/tasks/main.yml b/tests/integration/gcp_bigquery_dataset/tasks/main.yml index db480b7..9842164 100644 --- a/tests/integration/gcp_bigquery_dataset/tasks/main.yml +++ b/tests/integration/gcp_bigquery_dataset/tasks/main.yml @@ -15,23 +15,23 @@ # Pre-test setup - name: delete a dataset gcp_bigquery_dataset: - name: my_example_dataset - dataset_reference: - dataset_id: my_example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: my_example_dataset + dataset_reference: + dataset_id: my_example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a dataset gcp_bigquery_dataset: - name: my_example_dataset - dataset_reference: - dataset_id: my_example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: my_example_dataset + dataset_reference: + dataset_id: my_example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -53,13 +53,13 @@ # ---------------------------------------------------------------------------- - name: create a dataset that already exists gcp_bigquery_dataset: - name: my_example_dataset - dataset_reference: - dataset_id: my_example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: my_example_dataset + dataset_reference: + dataset_id: my_example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -69,13 +69,13 @@ #---------------------------------------------------------- - name: delete a dataset gcp_bigquery_dataset: - name: my_example_dataset - dataset_reference: - dataset_id: my_example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: my_example_dataset + dataset_reference: + dataset_id: my_example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -97,13 +97,13 @@ # ---------------------------------------------------------------------------- - name: delete a dataset that does not exist gcp_bigquery_dataset: - name: my_example_dataset - dataset_reference: - dataset_id: my_example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: my_example_dataset + dataset_reference: + dataset_id: my_example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/tests/integration/gcp_bigquery_table/tasks/main.yml b/tests/integration/gcp_bigquery_table/tasks/main.yml index c926621..3a1fda0 100644 --- a/tests/integration/gcp_bigquery_table/tasks/main.yml +++ b/tests/integration/gcp_bigquery_table/tasks/main.yml @@ -15,39 +15,39 @@ # Pre-test setup - name: create a dataset gcp_bigquery_dataset: - name: example_dataset - dataset_reference: - dataset_id: example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: example_dataset + dataset_reference: + dataset_id: example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: dataset - name: delete a table gcp_bigquery_table: - name: example_table - dataset: example_dataset - table_reference: - dataset_id: example_dataset - project_id: "{{ gcp_project }}" - table_id: example_table - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: example_table + dataset: example_dataset + table_reference: + dataset_id: example_dataset + project_id: "{{ gcp_project }}" + table_id: example_table + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a table gcp_bigquery_table: - name: example_table - dataset: example_dataset - table_reference: - dataset_id: example_dataset - project_id: "{{ gcp_project }}" - table_id: example_table - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: example_table + dataset: example_dataset + table_reference: + dataset_id: example_dataset + project_id: "{{ gcp_project }}" + table_id: example_table + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -70,16 +70,16 @@ # ---------------------------------------------------------------------------- - name: create a table that already exists gcp_bigquery_table: - name: example_table - dataset: example_dataset - table_reference: - dataset_id: example_dataset - project_id: "{{ gcp_project }}" - table_id: example_table - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: example_table + dataset: example_dataset + table_reference: + dataset_id: example_dataset + project_id: "{{ gcp_project }}" + table_id: example_table + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -89,16 +89,16 @@ #---------------------------------------------------------- - name: delete a table gcp_bigquery_table: - name: example_table - dataset: example_dataset - table_reference: - dataset_id: example_dataset - project_id: "{{ gcp_project }}" - table_id: example_table - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: example_table + dataset: example_dataset + table_reference: + dataset_id: example_dataset + project_id: "{{ gcp_project }}" + table_id: example_table + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -121,16 +121,16 @@ # ---------------------------------------------------------------------------- - name: delete a table that does not exist gcp_bigquery_table: - name: example_table - dataset: example_dataset - table_reference: - dataset_id: example_dataset - project_id: "{{ gcp_project }}" - table_id: example_table - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: example_table + dataset: example_dataset + table_reference: + dataset_id: example_dataset + project_id: "{{ gcp_project }}" + table_id: example_table + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -142,12 +142,12 @@ # If errors happen, don't crash the playbook! - name: delete a dataset gcp_bigquery_dataset: - name: example_dataset - dataset_reference: - dataset_id: example_dataset - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: example_dataset + dataset_reference: + dataset_id: example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: dataset ignore_errors: true diff --git a/tests/integration/gcp_compute_region_disk/tasks/main.yml b/tests/integration/gcp_compute_region_disk/tasks/main.yml index c20b77d..f693bbe 100644 --- a/tests/integration/gcp_compute_region_disk/tasks/main.yml +++ b/tests/integration/gcp_compute_region_disk/tasks/main.yml @@ -15,33 +15,33 @@ # Pre-test setup - name: delete a region disk gcp_compute_region_disk: - name: "{{ resource_name }}" - size_gb: 50 - disk_encryption_key: - raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= - region: us-central1 - replica_zones: - - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a - - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + region: us-central1 + replica_zones: + - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a + - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a region disk gcp_compute_region_disk: - name: "{{ resource_name }}" - size_gb: 50 - disk_encryption_key: - raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= - region: us-central1 - replica_zones: - - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a - - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + region: us-central1 + replica_zones: + - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a + - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -66,18 +66,18 @@ # ---------------------------------------------------------------------------- - name: create a region disk that already exists gcp_compute_region_disk: - name: "{{ resource_name }}" - size_gb: 50 - disk_encryption_key: - raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= - region: us-central1 - replica_zones: - - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a - - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + region: us-central1 + replica_zones: + - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a + - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -87,18 +87,18 @@ #---------------------------------------------------------- - name: delete a region disk gcp_compute_region_disk: - name: "{{ resource_name }}" - size_gb: 50 - disk_encryption_key: - raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= - region: us-central1 - replica_zones: - - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a - - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + region: us-central1 + replica_zones: + - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a + - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -123,18 +123,18 @@ # ---------------------------------------------------------------------------- - name: delete a region disk that does not exist gcp_compute_region_disk: - name: "{{ resource_name }}" - size_gb: 50 - disk_encryption_key: - raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= - region: us-central1 - replica_zones: - - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a - - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + region: us-central1 + replica_zones: + - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-a + - https://www.googleapis.com/compute/v1/projects/google.com:graphite-playground/zones/us-central1-b + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/tests/integration/gcp_compute_ssl_certificate/tasks/main.yml b/tests/integration/gcp_compute_ssl_certificate/tasks/main.yml index 0b402f6..afa6971 100644 --- a/tests/integration/gcp_compute_ssl_certificate/tasks/main.yml +++ b/tests/integration/gcp_compute_ssl_certificate/tasks/main.yml @@ -15,69 +15,45 @@ # Pre-test setup - name: delete a ssl certificate gcp_compute_ssl_certificate: - name: "{{ resource_name }}" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a ssl certificate gcp_compute_ssl_certificate: - name: "{{ resource_name }}" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -101,36 +77,24 @@ # ---------------------------------------------------------------------------- - name: create a ssl certificate that already exists gcp_compute_ssl_certificate: - name: "{{ resource_name }}" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -140,36 +104,24 @@ #---------------------------------------------------------- - name: delete a ssl certificate gcp_compute_ssl_certificate: - name: "{{ resource_name }}" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -193,36 +145,24 @@ # ---------------------------------------------------------------------------- - name: delete a ssl certificate that does not exist gcp_compute_ssl_certificate: - name: "{{ resource_name }}" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/tests/integration/gcp_compute_target_https_proxy/tasks/main.yml b/tests/integration/gcp_compute_target_https_proxy/tasks/main.yml index 7481605..d62cacb 100644 --- a/tests/integration/gcp_compute_target_https_proxy/tasks/main.yml +++ b/tests/integration/gcp_compute_target_https_proxy/tasks/main.yml @@ -58,36 +58,24 @@ register: urlmap - name: create a ssl certificate gcp_compute_ssl_certificate: - name: "sslcert-targethttpsproxy" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: sslcert-targethttpsproxy + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: sslcert - name: delete a target https proxy gcp_compute_target_https_proxy: @@ -200,36 +188,24 @@ # If errors happen, don't crash the playbook! - name: delete a ssl certificate gcp_compute_ssl_certificate: - name: "sslcert-targethttpsproxy" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: sslcert-targethttpsproxy + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: sslcert ignore_errors: true - name: delete a url map diff --git a/tests/integration/gcp_compute_target_ssl_proxy/tasks/main.yml b/tests/integration/gcp_compute_target_ssl_proxy/tasks/main.yml index 3625ce9..00215f7 100644 --- a/tests/integration/gcp_compute_target_ssl_proxy/tasks/main.yml +++ b/tests/integration/gcp_compute_target_ssl_proxy/tasks/main.yml @@ -53,36 +53,24 @@ register: backendservice - name: create a ssl certificate gcp_compute_ssl_certificate: - name: "sslcert-targetsslproxy" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: sslcert-targetsslproxy + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: sslcert - name: delete a target ssl proxy gcp_compute_target_ssl_proxy: @@ -195,36 +183,24 @@ # If errors happen, don't crash the playbook! - name: delete a ssl certificate gcp_compute_ssl_certificate: - name: "sslcert-targetsslproxy" - description: A certificate for testing. Do not use this certificate in production - certificate: | - -----BEGIN CERTIFICATE----- - MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG - EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT - BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm - b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN - AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 - MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP - BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM - FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z - aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH - KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ - 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O - BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn - 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O - M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ - zqGNhIPGq2ULqXKK8BY= - -----END CERTIFICATE----- - private_key: | - -----BEGIN EC PRIVATE KEY----- - MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 - AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f - OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== - -----END EC PRIVATE KEY----- - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: sslcert-targetsslproxy + description: A certificate for testing. Do not use this certificate in production + certificate: "-----BEGIN CERTIFICATE----- MIICqjCCAk+gAwIBAgIJAIuJ+0352Kq4MAoGCCqGSM49BAMCMIGwMQswCQYDVQQG + EwJVUzETMBEGA1UECAwKV2FzaGluZ3RvbjERMA8GA1UEBwwIS2lya2xhbmQxFTAT BgNVBAoMDEdvb2dsZSwgSW5jLjEeMBwGA1UECwwVR29vZ2xlIENsb3VkIFBsYXRm + b3JtMR8wHQYDVQQDDBZ3d3cubXktc2VjdXJlLXNpdGUuY29tMSEwHwYJKoZIhvcN AQkBFhJuZWxzb25hQGdvb2dsZS5jb20wHhcNMTcwNjI4MDQ1NjI2WhcNMjcwNjI2 + MDQ1NjI2WjCBsDELMAkGA1UEBhMCVVMxEzARBgNVBAgMCldhc2hpbmd0b24xETAP BgNVBAcMCEtpcmtsYW5kMRUwEwYDVQQKDAxHb29nbGUsIEluYy4xHjAcBgNVBAsM + FUdvb2dsZSBDbG91ZCBQbGF0Zm9ybTEfMB0GA1UEAwwWd3d3Lm15LXNlY3VyZS1z aXRlLmNvbTEhMB8GCSqGSIb3DQEJARYSbmVsc29uYUBnb29nbGUuY29tMFkwEwYH + KoZIzj0CAQYIKoZIzj0DAQcDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ 4mzkzTv0dXyB750fOGN02HtkpBOZzzvUARTR10JQoSe2/5PIwaNQME4wHQYDVR0O + BBYEFKIQC3A2SDpxcdfn0YLKineDNq/BMB8GA1UdIwQYMBaAFKIQC3A2SDpxcdfn 0YLKineDNq/BMAwGA1UdEwQFMAMBAf8wCgYIKoZIzj0EAwIDSQAwRgIhALs4vy+O + M3jcqgA4fSW/oKw6UJxp+M6a+nGMX+UJR3YgAiEAvvl39QRVAiv84hdoCuyON0lJ zqGNhIPGq2ULqXKK8BY= + -----END CERTIFICATE-----" + private_key: "-----BEGIN EC PRIVATE KEY----- MHcCAQEEIObtRo8tkUqoMjeHhsOh2ouPpXCgBcP+EDxZCB/tws15oAoGCCqGSM49 + AwEHoUQDQgAEHGzpcRJ4XzfBJCCPMQeXQpTXwlblimODQCuQ4mzkzTv0dXyB750f OGN02HtkpBOZzzvUARTR10JQoSe2/5PIwQ== + -----END EC PRIVATE KEY-----" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: sslcert ignore_errors: true - name: delete a backend service diff --git a/tests/integration/gcp_compute_vpn_tunnel/tasks/main.yml b/tests/integration/gcp_compute_vpn_tunnel/tasks/main.yml index eb9e5e8..9e9db55 100644 --- a/tests/integration/gcp_compute_vpn_tunnel/tasks/main.yml +++ b/tests/integration/gcp_compute_vpn_tunnel/tasks/main.yml @@ -15,63 +15,63 @@ # Pre-test setup - name: create a network gcp_compute_network: - name: "network-vpn-tunnel" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: network-vpn-tunnel + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: network - name: create a router gcp_compute_router: - name: "router-vpn-tunnel" - network: "{{ network }}" - bgp: - asn: 64514 - advertise_mode: CUSTOM - advertised_groups: - - ALL_SUBNETS - advertised_ip_ranges: - - range: 1.2.3.4 - - range: 6.7.0.0/16 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: router-vpn-tunnel + network: "{{ network }}" + bgp: + asn: 64514 + advertise_mode: CUSTOM + advertised_groups: + - ALL_SUBNETS + advertised_ip_ranges: + - range: 1.2.3.4 + - range: 6.7.0.0/16 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: router - name: create a target vpn gateway gcp_compute_target_vpn_gateway: - name: "gateway-vpn-tunnel" - region: us-west1 - network: "{{ network }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: gateway-vpn-tunnel + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: gateway - name: delete a vpn tunnel gcp_compute_vpn_tunnel: - name: "{{ resource_name }}" - region: us-west1 - target_vpn_gateway: "{{ gateway }}" - router: "{{ router }}" - shared_secret: super secret - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + target_vpn_gateway: "{{ gateway }}" + router: "{{ router }}" + shared_secret: super secret + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a vpn tunnel gcp_compute_vpn_tunnel: - name: "{{ resource_name }}" - region: us-west1 - target_vpn_gateway: "{{ gateway }}" - router: "{{ router }}" - shared_secret: super secret - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + region: us-west1 + target_vpn_gateway: "{{ gateway }}" + router: "{{ router }}" + shared_secret: super secret + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -96,15 +96,15 @@ # ---------------------------------------------------------------------------- - name: create a vpn tunnel that already exists gcp_compute_vpn_tunnel: - name: "{{ resource_name }}" - region: us-west1 - target_vpn_gateway: "{{ gateway }}" - router: "{{ router }}" - shared_secret: super secret - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + region: us-west1 + target_vpn_gateway: "{{ gateway }}" + router: "{{ router }}" + shared_secret: super secret + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -114,15 +114,15 @@ #---------------------------------------------------------- - name: delete a vpn tunnel gcp_compute_vpn_tunnel: - name: "{{ resource_name }}" - region: us-west1 - target_vpn_gateway: "{{ gateway }}" - router: "{{ router }}" - shared_secret: super secret - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + target_vpn_gateway: "{{ gateway }}" + router: "{{ router }}" + shared_secret: super secret + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -147,15 +147,15 @@ # ---------------------------------------------------------------------------- - name: delete a vpn tunnel that does not exist gcp_compute_vpn_tunnel: - name: "{{ resource_name }}" - region: us-west1 - target_vpn_gateway: "{{ gateway }}" - router: "{{ router }}" - shared_secret: super secret - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + region: us-west1 + target_vpn_gateway: "{{ gateway }}" + router: "{{ router }}" + shared_secret: super secret + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -167,40 +167,40 @@ # If errors happen, don't crash the playbook! - name: delete a target vpn gateway gcp_compute_target_vpn_gateway: - name: "gateway-vpn-tunnel" - region: us-west1 - network: "{{ network }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: gateway-vpn-tunnel + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: gateway ignore_errors: true - name: delete a router gcp_compute_router: - name: "router-vpn-tunnel" - network: "{{ network }}" - bgp: - asn: 64514 - advertise_mode: CUSTOM - advertised_groups: - - ALL_SUBNETS - advertised_ip_ranges: - - range: 1.2.3.4 - - range: 6.7.0.0/16 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: router-vpn-tunnel + network: "{{ network }}" + bgp: + asn: 64514 + advertise_mode: CUSTOM + advertised_groups: + - ALL_SUBNETS + advertised_ip_ranges: + - range: 1.2.3.4 + - range: 6.7.0.0/16 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: router ignore_errors: true - name: delete a network gcp_compute_network: - name: "network-vpn-tunnel" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: network-vpn-tunnel + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: network ignore_errors: true diff --git a/tests/integration/gcp_container_cluster/tasks/main.yml b/tests/integration/gcp_container_cluster/tasks/main.yml index 1785c26..ebf2fa5 100644 --- a/tests/integration/gcp_container_cluster/tasks/main.yml +++ b/tests/integration/gcp_container_cluster/tasks/main.yml @@ -15,35 +15,35 @@ # Pre-test setup - name: delete a cluster gcp_container_cluster: - name: my-cluster - initial_node_count: 2 - master_auth: - username: cluster_admin - password: my-secret-password - node_config: - machine_type: n1-standard-4 - disk_size_gb: 500 - location: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: my-cluster + initial_node_count: 2 + master_auth: + username: cluster_admin + password: my-secret-password + node_config: + machine_type: n1-standard-4 + disk_size_gb: 500 + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a cluster gcp_container_cluster: - name: my-cluster - initial_node_count: 2 - master_auth: - username: cluster_admin - password: my-secret-password - node_config: - machine_type: n1-standard-4 - disk_size_gb: 500 - location: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: my-cluster + initial_node_count: 2 + master_auth: + username: cluster_admin + password: my-secret-password + node_config: + machine_type: n1-standard-4 + disk_size_gb: 500 + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -65,19 +65,19 @@ # ---------------------------------------------------------------------------- - name: create a cluster that already exists gcp_container_cluster: - name: my-cluster - initial_node_count: 2 - master_auth: - username: cluster_admin - password: my-secret-password - node_config: - machine_type: n1-standard-4 - disk_size_gb: 500 - location: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: my-cluster + initial_node_count: 2 + master_auth: + username: cluster_admin + password: my-secret-password + node_config: + machine_type: n1-standard-4 + disk_size_gb: 500 + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -86,19 +86,19 @@ #---------------------------------------------------------- - name: delete a cluster gcp_container_cluster: - name: my-cluster - initial_node_count: 2 - master_auth: - username: cluster_admin - password: my-secret-password - node_config: - machine_type: n1-standard-4 - disk_size_gb: 500 - location: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: my-cluster + initial_node_count: 2 + master_auth: + username: cluster_admin + password: my-secret-password + node_config: + machine_type: n1-standard-4 + disk_size_gb: 500 + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -120,19 +120,19 @@ # ---------------------------------------------------------------------------- - name: delete a cluster that does not exist gcp_container_cluster: - name: my-cluster - initial_node_count: 2 - master_auth: - username: cluster_admin - password: my-secret-password - node_config: - machine_type: n1-standard-4 - disk_size_gb: 500 - location: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: my-cluster + initial_node_count: 2 + master_auth: + username: cluster_admin + password: my-secret-password + node_config: + machine_type: n1-standard-4 + disk_size_gb: 500 + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/tests/integration/gcp_container_node_pool/tasks/main.yml b/tests/integration/gcp_container_node_pool/tasks/main.yml index 775d6a4..3d41089 100644 --- a/tests/integration/gcp_container_node_pool/tasks/main.yml +++ b/tests/integration/gcp_container_node_pool/tasks/main.yml @@ -15,35 +15,35 @@ # Pre-test setup - name: create a cluster gcp_container_cluster: - name: "cluster-nodepool" - initial_node_count: 4 - location: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: cluster-nodepool + initial_node_count: 4 + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: cluster - name: delete a node pool gcp_container_node_pool: - name: my-pool - initial_node_count: 4 - cluster: "{{ cluster }}" - location: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: my-pool + initial_node_count: 4 + cluster: "{{ cluster }}" + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a node pool gcp_container_node_pool: - name: my-pool - initial_node_count: 4 - cluster: "{{ cluster }}" - location: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: my-pool + initial_node_count: 4 + cluster: "{{ cluster }}" + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -66,14 +66,14 @@ # ---------------------------------------------------------------------------- - name: create a node pool that already exists gcp_container_node_pool: - name: my-pool - initial_node_count: 4 - cluster: "{{ cluster }}" - location: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: my-pool + initial_node_count: 4 + cluster: "{{ cluster }}" + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -82,14 +82,14 @@ #---------------------------------------------------------- - name: delete a node pool gcp_container_node_pool: - name: my-pool - initial_node_count: 4 - cluster: "{{ cluster }}" - location: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: my-pool + initial_node_count: 4 + cluster: "{{ cluster }}" + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -112,14 +112,14 @@ # ---------------------------------------------------------------------------- - name: delete a node pool that does not exist gcp_container_node_pool: - name: my-pool - initial_node_count: 4 - cluster: "{{ cluster }}" - location: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: my-pool + initial_node_count: 4 + cluster: "{{ cluster }}" + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -130,12 +130,12 @@ # If errors happen, don't crash the playbook! - name: delete a cluster gcp_container_cluster: - name: "cluster-nodepool" - initial_node_count: 4 - location: us-central1-a - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: cluster-nodepool + initial_node_count: 4 + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: cluster ignore_errors: true diff --git a/tests/integration/gcp_dns_resource_record_set/tasks/main.yml b/tests/integration/gcp_dns_resource_record_set/tasks/main.yml index ce4c8e9..55a56e0 100644 --- a/tests/integration/gcp_dns_resource_record_set/tasks/main.yml +++ b/tests/integration/gcp_dns_resource_record_set/tasks/main.yml @@ -25,31 +25,31 @@ register: managed_zone - name: delete a resource record set gcp_dns_resource_record_set: - name: www.testzone-4.com. - managed_zone: "{{ managed_zone }}" - type: A - ttl: 600 - target: - - 10.1.2.3 - - 40.5.6.7 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: www.testzone-4.com. + managed_zone: "{{ managed_zone }}" + type: A + ttl: 600 + target: + - 10.1.2.3 + - 40.5.6.7 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a resource record set gcp_dns_resource_record_set: - name: www.testzone-4.com. - managed_zone: "{{ managed_zone }}" - type: A - ttl: 600 - target: - - 10.1.2.3 - - 40.5.6.7 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: www.testzone-4.com. + managed_zone: "{{ managed_zone }}" + type: A + ttl: 600 + target: + - 10.1.2.3 + - 40.5.6.7 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -72,17 +72,17 @@ # ---------------------------------------------------------------------------- - name: create a resource record set that already exists gcp_dns_resource_record_set: - name: www.testzone-4.com. - managed_zone: "{{ managed_zone }}" - type: A - ttl: 600 - target: - - 10.1.2.3 - - 40.5.6.7 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: www.testzone-4.com. + managed_zone: "{{ managed_zone }}" + type: A + ttl: 600 + target: + - 10.1.2.3 + - 40.5.6.7 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -92,17 +92,17 @@ #---------------------------------------------------------- - name: delete a resource record set gcp_dns_resource_record_set: - name: www.testzone-4.com. - managed_zone: "{{ managed_zone }}" - type: A - ttl: 600 - target: - - 10.1.2.3 - - 40.5.6.7 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: www.testzone-4.com. + managed_zone: "{{ managed_zone }}" + type: A + ttl: 600 + target: + - 10.1.2.3 + - 40.5.6.7 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -125,17 +125,17 @@ # ---------------------------------------------------------------------------- - name: delete a resource record set that does not exist gcp_dns_resource_record_set: - name: www.testzone-4.com. - managed_zone: "{{ managed_zone }}" - type: A - ttl: 600 - target: - - 10.1.2.3 - - 40.5.6.7 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: www.testzone-4.com. + managed_zone: "{{ managed_zone }}" + type: A + ttl: 600 + target: + - 10.1.2.3 + - 40.5.6.7 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/tests/integration/gcp_iam_role/tasks/main.yml b/tests/integration/gcp_iam_role/tasks/main.yml index 665a679..6299f76 100644 --- a/tests/integration/gcp_iam_role/tasks/main.yml +++ b/tests/integration/gcp_iam_role/tasks/main.yml @@ -15,31 +15,31 @@ # Pre-test setup - name: delete a role gcp_iam_role: - name: myCustomRole2 - title: My Custom Role - description: My custom role description - included_permissions: - - iam.roles.list - - iam.roles.create - - iam.roles.delete - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: myCustomRole2 + title: My Custom Role + description: My custom role description + included_permissions: + - iam.roles.list + - iam.roles.create + - iam.roles.delete + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a role gcp_iam_role: - name: myCustomRole2 - title: My Custom Role - description: My custom role description - included_permissions: - - iam.roles.list - - iam.roles.create - - iam.roles.delete - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: myCustomRole2 + title: My Custom Role + description: My custom role description + included_permissions: + - iam.roles.list + - iam.roles.create + - iam.roles.delete + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -60,17 +60,17 @@ # ---------------------------------------------------------------------------- - name: create a role that already exists gcp_iam_role: - name: myCustomRole2 - title: My Custom Role - description: My custom role description - included_permissions: - - iam.roles.list - - iam.roles.create - - iam.roles.delete - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: myCustomRole2 + title: My Custom Role + description: My custom role description + included_permissions: + - iam.roles.list + - iam.roles.create + - iam.roles.delete + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -79,17 +79,17 @@ #---------------------------------------------------------- - name: delete a role gcp_iam_role: - name: myCustomRole2 - title: My Custom Role - description: My custom role description - included_permissions: - - iam.roles.list - - iam.roles.create - - iam.roles.delete - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: myCustomRole2 + title: My Custom Role + description: My custom role description + included_permissions: + - iam.roles.list + - iam.roles.create + - iam.roles.delete + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -110,17 +110,17 @@ # ---------------------------------------------------------------------------- - name: delete a role that does not exist gcp_iam_role: - name: myCustomRole2 - title: My Custom Role - description: My custom role description - included_permissions: - - iam.roles.list - - iam.roles.create - - iam.roles.delete - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: myCustomRole2 + title: My Custom Role + description: My custom role description + included_permissions: + - iam.roles.list + - iam.roles.create + - iam.roles.delete + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/tests/integration/gcp_iam_service_account/tasks/main.yml b/tests/integration/gcp_iam_service_account/tasks/main.yml index 2e06eb7..496b31b 100644 --- a/tests/integration/gcp_iam_service_account/tasks/main.yml +++ b/tests/integration/gcp_iam_service_account/tasks/main.yml @@ -15,25 +15,21 @@ # Pre-test setup - name: delete a service account gcp_iam_service_account: - name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" - - ' - display_name: My Ansible test key - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com"' + display_name: My Ansible test key + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a service account gcp_iam_service_account: - name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" - - ' - display_name: My Ansible test key - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com"' + display_name: My Ansible test key + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -54,14 +50,12 @@ # ---------------------------------------------------------------------------- - name: create a service account that already exists gcp_iam_service_account: - name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" - - ' - display_name: My Ansible test key - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com"' + display_name: My Ansible test key + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -70,14 +64,12 @@ #---------------------------------------------------------- - name: delete a service account gcp_iam_service_account: - name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" - - ' - display_name: My Ansible test key - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com"' + display_name: My Ansible test key + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -98,14 +90,12 @@ # ---------------------------------------------------------------------------- - name: delete a service account that does not exist gcp_iam_service_account: - name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" - - ' - display_name: My Ansible test key - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com"' + display_name: My Ansible test key + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/tests/integration/gcp_pubsub_subscription/tasks/main.yml b/tests/integration/gcp_pubsub_subscription/tasks/main.yml index 41277cc..8a05e2a 100644 --- a/tests/integration/gcp_pubsub_subscription/tasks/main.yml +++ b/tests/integration/gcp_pubsub_subscription/tasks/main.yml @@ -23,23 +23,23 @@ register: topic - name: delete a subscription gcp_pubsub_subscription: - name: "{{ resource_name }}" - topic: "{{ topic }}" - ack_deadline_seconds: 300 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + topic: "{{ topic }}" + ack_deadline_seconds: 300 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a subscription gcp_pubsub_subscription: - name: "{{ resource_name }}" - topic: "{{ topic }}" - ack_deadline_seconds: 300 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + topic: "{{ topic }}" + ack_deadline_seconds: 300 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -60,13 +60,13 @@ # ---------------------------------------------------------------------------- - name: create a subscription that already exists gcp_pubsub_subscription: - name: "{{ resource_name }}" - topic: "{{ topic }}" - ack_deadline_seconds: 300 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + topic: "{{ topic }}" + ack_deadline_seconds: 300 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -75,13 +75,13 @@ #---------------------------------------------------------- - name: delete a subscription gcp_pubsub_subscription: - name: "{{ resource_name }}" - topic: "{{ topic }}" - ack_deadline_seconds: 300 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + topic: "{{ topic }}" + ack_deadline_seconds: 300 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -102,13 +102,13 @@ # ---------------------------------------------------------------------------- - name: delete a subscription that does not exist gcp_pubsub_subscription: - name: "{{ resource_name }}" - topic: "{{ topic }}" - ack_deadline_seconds: 300 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + topic: "{{ topic }}" + ack_deadline_seconds: 300 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/tests/integration/gcp_redis_instance/tasks/main.yml b/tests/integration/gcp_redis_instance/tasks/main.yml index b260311..55febdb 100644 --- a/tests/integration/gcp_redis_instance/tasks/main.yml +++ b/tests/integration/gcp_redis_instance/tasks/main.yml @@ -15,47 +15,47 @@ # Pre-test setup - name: create a network gcp_compute_network: - name: "network-instance" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: network-instance + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: network - name: delete a instance gcp_redis_instance: - name: instance37 - tier: STANDARD_HA - memory_size_gb: 1 - region: us-central1 - location_id: us-central1-a - redis_version: REDIS_3_2 - display_name: Ansible Test Instance - reserved_ip_range: 192.168.0.0/29 - labels: - my_key: my_val - other_key: other_val - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: instance37 + tier: STANDARD_HA + memory_size_gb: 1 + region: us-central1 + location_id: us-central1-a + redis_version: REDIS_3_2 + display_name: Ansible Test Instance + reserved_ip_range: 192.168.0.0/29 + labels: + my_key: my_val + other_key: other_val + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a instance gcp_redis_instance: - name: instance37 - tier: STANDARD_HA - memory_size_gb: 1 - region: us-central1 - location_id: us-central1-a - redis_version: REDIS_3_2 - display_name: Ansible Test Instance - reserved_ip_range: 192.168.0.0/29 - labels: - my_key: my_val - other_key: other_val - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instance37 + tier: STANDARD_HA + memory_size_gb: 1 + region: us-central1 + location_id: us-central1-a + redis_version: REDIS_3_2 + display_name: Ansible Test Instance + reserved_ip_range: 192.168.0.0/29 + labels: + my_key: my_val + other_key: other_val + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -77,21 +77,21 @@ # ---------------------------------------------------------------------------- - name: create a instance that already exists gcp_redis_instance: - name: instance37 - tier: STANDARD_HA - memory_size_gb: 1 - region: us-central1 - location_id: us-central1-a - redis_version: REDIS_3_2 - display_name: Ansible Test Instance - reserved_ip_range: 192.168.0.0/29 - labels: - my_key: my_val - other_key: other_val - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: instance37 + tier: STANDARD_HA + memory_size_gb: 1 + region: us-central1 + location_id: us-central1-a + redis_version: REDIS_3_2 + display_name: Ansible Test Instance + reserved_ip_range: 192.168.0.0/29 + labels: + my_key: my_val + other_key: other_val + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -100,21 +100,21 @@ #---------------------------------------------------------- - name: delete a instance gcp_redis_instance: - name: instance37 - tier: STANDARD_HA - memory_size_gb: 1 - region: us-central1 - location_id: us-central1-a - redis_version: REDIS_3_2 - display_name: Ansible Test Instance - reserved_ip_range: 192.168.0.0/29 - labels: - my_key: my_val - other_key: other_val - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: instance37 + tier: STANDARD_HA + memory_size_gb: 1 + region: us-central1 + location_id: us-central1-a + redis_version: REDIS_3_2 + display_name: Ansible Test Instance + reserved_ip_range: 192.168.0.0/29 + labels: + my_key: my_val + other_key: other_val + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -136,21 +136,21 @@ # ---------------------------------------------------------------------------- - name: delete a instance that does not exist gcp_redis_instance: - name: instance37 - tier: STANDARD_HA - memory_size_gb: 1 - region: us-central1 - location_id: us-central1-a - redis_version: REDIS_3_2 - display_name: Ansible Test Instance - reserved_ip_range: 192.168.0.0/29 - labels: - my_key: my_val - other_key: other_val - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: instance37 + tier: STANDARD_HA + memory_size_gb: 1 + region: us-central1 + location_id: us-central1-a + redis_version: REDIS_3_2 + display_name: Ansible Test Instance + reserved_ip_range: 192.168.0.0/29 + labels: + my_key: my_val + other_key: other_val + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -161,10 +161,10 @@ # If errors happen, don't crash the playbook! - name: delete a network gcp_compute_network: - name: "network-instance" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: network-instance + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: network ignore_errors: true diff --git a/tests/integration/gcp_resourcemanager_project/tasks/main.yml b/tests/integration/gcp_resourcemanager_project/tasks/main.yml index 3695225..50cb586 100644 --- a/tests/integration/gcp_resourcemanager_project/tasks/main.yml +++ b/tests/integration/gcp_resourcemanager_project/tasks/main.yml @@ -15,25 +15,25 @@ # Pre-test setup - name: delete a project gcp_resourcemanager_project: - name: My Sample Project - id: alextest-{{ 10000000000 | random }} - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - parent: - type: organization - id: 636173955921 - state: absent + name: My Sample Project + id: alextest-{{ 10000000000 | random }} + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + parent: + type: organization + id: 636173955921 + state: absent #---------------------------------------------------------- - name: create a project gcp_resourcemanager_project: - name: My Sample Project - id: alextest-{{ 10000000000 | random }} - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - parent: - type: organization - id: 636173955921 - state: present + name: My Sample Project + id: alextest-{{ 10000000000 | random }} + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + parent: + type: organization + id: 636173955921 + state: present register: result - name: assert changed is true assert: @@ -54,14 +54,14 @@ # ---------------------------------------------------------------------------- - name: create a project that already exists gcp_resourcemanager_project: - name: My Sample Project - id: alextest-{{ 10000000000 | random }} - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - parent: - type: organization - id: 636173955921 - state: present + name: My Sample Project + id: alextest-{{ 10000000000 | random }} + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + parent: + type: organization + id: 636173955921 + state: present register: result - name: assert changed is false assert: @@ -70,14 +70,14 @@ #---------------------------------------------------------- - name: delete a project gcp_resourcemanager_project: - name: My Sample Project - id: alextest-{{ 10000000000 | random }} - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - parent: - type: organization - id: 636173955921 - state: absent + name: My Sample Project + id: alextest-{{ 10000000000 | random }} + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + parent: + type: organization + id: 636173955921 + state: absent register: result - name: assert changed is true assert: @@ -98,14 +98,14 @@ # ---------------------------------------------------------------------------- - name: delete a project that does not exist gcp_resourcemanager_project: - name: My Sample Project - id: alextest-{{ 10000000000 | random }} - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - parent: - type: organization - id: 636173955921 - state: absent + name: My Sample Project + id: alextest-{{ 10000000000 | random }} + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + parent: + type: organization + id: 636173955921 + state: absent register: result - name: assert changed is false assert: diff --git a/tests/integration/gcp_sourcerepo_repository/tasks/main.yml b/tests/integration/gcp_sourcerepo_repository/tasks/main.yml index bd3048a..5d704fc 100644 --- a/tests/integration/gcp_sourcerepo_repository/tasks/main.yml +++ b/tests/integration/gcp_sourcerepo_repository/tasks/main.yml @@ -15,19 +15,19 @@ # Pre-test setup - name: delete a repository gcp_sourcerepo_repository: - name: projects/{{ gcp_project }}/repos/{{ resource_name }} - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: projects/{{ gcp_project }}/repos/{{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a repository gcp_sourcerepo_repository: - name: projects/{{ gcp_project }}/repos/{{ resource_name }} - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: projects/{{ gcp_project }}/repos/{{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -48,11 +48,11 @@ # ---------------------------------------------------------------------------- - name: create a repository that already exists gcp_sourcerepo_repository: - name: projects/{{ gcp_project }}/repos/{{ resource_name }} - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: projects/{{ gcp_project }}/repos/{{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -61,11 +61,11 @@ #---------------------------------------------------------- - name: delete a repository gcp_sourcerepo_repository: - name: projects/{{ gcp_project }}/repos/{{ resource_name }} - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: projects/{{ gcp_project }}/repos/{{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -86,11 +86,11 @@ # ---------------------------------------------------------------------------- - name: delete a repository that does not exist gcp_sourcerepo_repository: - name: projects/{{ gcp_project }}/repos/{{ resource_name }} - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: projects/{{ gcp_project }}/repos/{{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/tests/integration/gcp_spanner_instance/tasks/main.yml b/tests/integration/gcp_spanner_instance/tasks/main.yml index d3280e5..15c7206 100644 --- a/tests/integration/gcp_spanner_instance/tasks/main.yml +++ b/tests/integration/gcp_spanner_instance/tasks/main.yml @@ -15,29 +15,29 @@ # Pre-test setup - name: delete a instance gcp_spanner_instance: - name: testinstance - display_name: My Spanner Instance - node_count: 2 - labels: - cost_center: ti-1700004 - config: regional-us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: testinstance + display_name: My Spanner Instance + node_count: 2 + labels: + cost_center: ti-1700004 + config: regional-us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a instance gcp_spanner_instance: - name: testinstance - display_name: My Spanner Instance - node_count: 2 - labels: - cost_center: ti-1700004 - config: regional-us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: testinstance + display_name: My Spanner Instance + node_count: 2 + labels: + cost_center: ti-1700004 + config: regional-us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -58,16 +58,16 @@ # ---------------------------------------------------------------------------- - name: create a instance that already exists gcp_spanner_instance: - name: testinstance - display_name: My Spanner Instance - node_count: 2 - labels: - cost_center: ti-1700004 - config: regional-us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: testinstance + display_name: My Spanner Instance + node_count: 2 + labels: + cost_center: ti-1700004 + config: regional-us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -76,16 +76,16 @@ #---------------------------------------------------------- - name: delete a instance gcp_spanner_instance: - name: testinstance - display_name: My Spanner Instance - node_count: 2 - labels: - cost_center: ti-1700004 - config: regional-us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: testinstance + display_name: My Spanner Instance + node_count: 2 + labels: + cost_center: ti-1700004 + config: regional-us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -106,16 +106,16 @@ # ---------------------------------------------------------------------------- - name: delete a instance that does not exist gcp_spanner_instance: - name: testinstance - display_name: My Spanner Instance - node_count: 2 - labels: - cost_center: ti-1700004 - config: regional-us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: testinstance + display_name: My Spanner Instance + node_count: 2 + labels: + cost_center: ti-1700004 + config: regional-us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/tests/integration/gcp_sql_database/tasks/main.yml b/tests/integration/gcp_sql_database/tasks/main.yml index 4f73c1c..5321004 100644 --- a/tests/integration/gcp_sql_database/tasks/main.yml +++ b/tests/integration/gcp_sql_database/tasks/main.yml @@ -15,18 +15,18 @@ # Pre-test setup - name: create a instance gcp_sql_instance: - name: "{{resource_name}}-3" - settings: - ip_configuration: - authorized_networks: - - name: google dns server - value: 8.8.8.8/32 - tier: db-n1-standard-1 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{resource_name}}-3" + settings: + ip_configuration: + authorized_networks: + - name: google dns server + value: 8.8.8.8/32 + tier: db-n1-standard-1 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instance - name: delete a database gcp_sql_database: @@ -132,17 +132,17 @@ # If errors happen, don't crash the playbook! - name: delete a instance gcp_sql_instance: - name: "{{resource_name}}-3" - settings: - ip_configuration: - authorized_networks: - - name: google dns server - value: 8.8.8.8/32 - tier: db-n1-standard-1 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{resource_name}}-3" + settings: + ip_configuration: + authorized_networks: + - name: google dns server + value: 8.8.8.8/32 + tier: db-n1-standard-1 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: instance ignore_errors: true diff --git a/tests/integration/gcp_sql_instance/tasks/main.yml b/tests/integration/gcp_sql_instance/tasks/main.yml index fa7690c..eace727 100644 --- a/tests/integration/gcp_sql_instance/tasks/main.yml +++ b/tests/integration/gcp_sql_instance/tasks/main.yml @@ -15,33 +15,33 @@ # Pre-test setup - name: delete a instance gcp_sql_instance: - name: "{{resource_name}}-2" - settings: - ip_configuration: - authorized_networks: - - name: google dns server - value: 8.8.8.8/32 - tier: db-n1-standard-1 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{resource_name}}-2" + settings: + ip_configuration: + authorized_networks: + - name: google dns server + value: 8.8.8.8/32 + tier: db-n1-standard-1 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a instance gcp_sql_instance: - name: "{{resource_name}}-2" - settings: - ip_configuration: - authorized_networks: - - name: google dns server - value: 8.8.8.8/32 - tier: db-n1-standard-1 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{resource_name}}-2" + settings: + ip_configuration: + authorized_networks: + - name: google dns server + value: 8.8.8.8/32 + tier: db-n1-standard-1 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -63,18 +63,18 @@ # ---------------------------------------------------------------------------- - name: create a instance that already exists gcp_sql_instance: - name: "{{resource_name}}-2" - settings: - ip_configuration: - authorized_networks: - - name: google dns server - value: 8.8.8.8/32 - tier: db-n1-standard-1 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{resource_name}}-2" + settings: + ip_configuration: + authorized_networks: + - name: google dns server + value: 8.8.8.8/32 + tier: db-n1-standard-1 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -84,18 +84,18 @@ #---------------------------------------------------------- - name: delete a instance gcp_sql_instance: - name: "{{resource_name}}-2" - settings: - ip_configuration: - authorized_networks: - - name: google dns server - value: 8.8.8.8/32 - tier: db-n1-standard-1 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{resource_name}}-2" + settings: + ip_configuration: + authorized_networks: + - name: google dns server + value: 8.8.8.8/32 + tier: db-n1-standard-1 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -117,18 +117,18 @@ # ---------------------------------------------------------------------------- - name: delete a instance that does not exist gcp_sql_instance: - name: "{{resource_name}}-2" - settings: - ip_configuration: - authorized_networks: - - name: google dns server - value: 8.8.8.8/32 - tier: db-n1-standard-1 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{resource_name}}-2" + settings: + ip_configuration: + authorized_networks: + - name: google dns server + value: 8.8.8.8/32 + tier: db-n1-standard-1 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: diff --git a/tests/integration/gcp_sql_user/tasks/main.yml b/tests/integration/gcp_sql_user/tasks/main.yml index b566961..653308c 100644 --- a/tests/integration/gcp_sql_user/tasks/main.yml +++ b/tests/integration/gcp_sql_user/tasks/main.yml @@ -15,18 +15,18 @@ # Pre-test setup - name: create a instance gcp_sql_instance: - name: "{{resource_name}}-1" - settings: - ip_configuration: - authorized_networks: - - name: google dns server - value: 8.8.8.8/32 - tier: db-n1-standard-1 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{resource_name}}-1" + settings: + ip_configuration: + authorized_networks: + - name: google dns server + value: 8.8.8.8/32 + tier: db-n1-standard-1 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: instance - name: delete a user gcp_sql_user: @@ -137,17 +137,17 @@ # If errors happen, don't crash the playbook! - name: delete a instance gcp_sql_instance: - name: "{{resource_name}}-1" - settings: - ip_configuration: - authorized_networks: - - name: google dns server - value: 8.8.8.8/32 - tier: db-n1-standard-1 - region: us-central1 - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{resource_name}}-1" + settings: + ip_configuration: + authorized_networks: + - name: google dns server + value: 8.8.8.8/32 + tier: db-n1-standard-1 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: instance ignore_errors: true diff --git a/tests/integration/gcp_storage_bucket_access_control/tasks/main.yml b/tests/integration/gcp_storage_bucket_access_control/tasks/main.yml index f71247c..52c63b6 100644 --- a/tests/integration/gcp_storage_bucket_access_control/tasks/main.yml +++ b/tests/integration/gcp_storage_bucket_access_control/tasks/main.yml @@ -15,31 +15,31 @@ # Pre-test setup - name: create a bucket gcp_storage_bucket: - name: "{{ resource_name }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: bucket - name: delete a bucket access control gcp_storage_bucket_access_control: - bucket: "{{ resource_name }}" - entity: user-alexstephen@google.com - role: WRITER - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + bucket: "{{ resource_name }}" + entity: user-alexstephen@google.com + role: WRITER + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent #---------------------------------------------------------- - name: create a bucket access control gcp_storage_bucket_access_control: - bucket: "{{ resource_name }}" - entity: user-alexstephen@google.com - role: WRITER - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + bucket: "{{ resource_name }}" + entity: user-alexstephen@google.com + role: WRITER + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is true assert: @@ -49,13 +49,13 @@ # ---------------------------------------------------------------------------- - name: create a bucket access control that already exists gcp_storage_bucket_access_control: - bucket: "{{ resource_name }}" - entity: user-alexstephen@google.com - role: WRITER - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: present + bucket: "{{ resource_name }}" + entity: user-alexstephen@google.com + role: WRITER + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present register: result - name: assert changed is false assert: @@ -65,13 +65,13 @@ #---------------------------------------------------------- - name: delete a bucket access control gcp_storage_bucket_access_control: - bucket: "{{ resource_name }}" - entity: user-alexstephen@google.com - role: WRITER - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + bucket: "{{ resource_name }}" + entity: user-alexstephen@google.com + role: WRITER + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is true assert: @@ -81,13 +81,13 @@ # ---------------------------------------------------------------------------- - name: delete a bucket access control that does not exist gcp_storage_bucket_access_control: - bucket: "{{ resource_name }}" - entity: user-alexstephen@google.com - role: WRITER - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + bucket: "{{ resource_name }}" + entity: user-alexstephen@google.com + role: WRITER + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: result - name: assert changed is false assert: @@ -99,10 +99,10 @@ # If errors happen, don't crash the playbook! - name: delete a bucket gcp_storage_bucket: - name: "{{ resource_name }}" - project: "{{ gcp_project }}" - auth_kind: "{{ gcp_cred_kind }}" - service_account_file: "{{ gcp_cred_file }}" - state: absent + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent register: bucket ignore_errors: true