diff --git a/plugins/modules/gcp_compute_vpn_tunnel.py b/plugins/modules/gcp_compute_vpn_tunnel.py index 1ffdc3f39b7029..a67831271f61d0 100644 --- a/plugins/modules/gcp_compute_vpn_tunnel.py +++ b/plugins/modules/gcp_compute_vpn_tunnel.py @@ -161,8 +161,8 @@ state: present register: gateway -- name: create a vpn-tunnel - gcp_compute_vpn-tunnel: +- name: create a vpn tunnel + gcp_compute_vpn_tunnel: name: "test_object" region: us-west1 target_vpn_gateway: "{{ gateway }}" diff --git a/plugins/modules/gcp_iam_service_account.py b/plugins/modules/gcp_iam_service_account.py index 122c32b51157fc..07e337e63277b9 100644 --- a/plugins/modules/gcp_iam_service_account.py +++ b/plugins/modules/gcp_iam_service_account.py @@ -62,7 +62,9 @@ EXAMPLES = ''' - name: create a service account gcp_iam_service_account: - name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com + name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" + + ' display_name: My Ansible test key project: "test_project" auth_kind: "serviceaccount" diff --git a/plugins/modules/gcp_sql_database.py b/plugins/modules/gcp_sql_database.py index 8a93aaf15d2125..1a8af8d3b3b352 100644 --- a/plugins/modules/gcp_sql_database.py +++ b/plugins/modules/gcp_sql_database.py @@ -75,7 +75,7 @@ EXAMPLES = ''' - name: create a instance gcp_sql_instance: - name: "{{ resource_name }}" + name: "{{resource_name}}-3" settings: ip_configuration: authorized_networks: diff --git a/plugins/modules/gcp_sql_instance.py b/plugins/modules/gcp_sql_instance.py index d2b45bf3f434f9..70f66b4f164861 100644 --- a/plugins/modules/gcp_sql_instance.py +++ b/plugins/modules/gcp_sql_instance.py @@ -272,7 +272,7 @@ EXAMPLES = ''' - name: create a instance gcp_sql_instance: - name: "test_object" + name: "{{resource_name}}-2" settings: ip_configuration: authorized_networks: diff --git a/plugins/modules/gcp_sql_user.py b/plugins/modules/gcp_sql_user.py index bc01654c5d662f..31e5ef015c35ca 100644 --- a/plugins/modules/gcp_sql_user.py +++ b/plugins/modules/gcp_sql_user.py @@ -76,7 +76,7 @@ EXAMPLES = ''' - name: create a instance gcp_sql_instance: - name: "{{ resource_name }}" + name: "{{resource_name}}-1" settings: ip_configuration: authorized_networks: diff --git a/plugins/modules/gcp_storage_bucket_access_control.py b/plugins/modules/gcp_storage_bucket_access_control.py index cb6a0b12be03fd..4c9e02c1409ce6 100644 --- a/plugins/modules/gcp_storage_bucket_access_control.py +++ b/plugins/modules/gcp_storage_bucket_access_control.py @@ -109,11 +109,11 @@ 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 diff --git a/tests/integration/gcp_compute_vpn_tunnel/tasks/main.yml b/tests/integration/gcp_compute_vpn_tunnel/tasks/main.yml index fb264f6855f3cd..eb9e5e8494bc2b 100644 --- a/tests/integration/gcp_compute_vpn_tunnel/tasks/main.yml +++ b/tests/integration/gcp_compute_vpn_tunnel/tasks/main.yml @@ -49,8 +49,8 @@ service_account_file: "{{ gcp_cred_file }}" state: present register: gateway -- name: delete a vpn-tunnel - gcp_compute_vpn-tunnel: +- name: delete a vpn tunnel + gcp_compute_vpn_tunnel: name: "{{ resource_name }}" region: us-west1 target_vpn_gateway: "{{ gateway }}" @@ -61,8 +61,8 @@ service_account_file: "{{ gcp_cred_file }}" state: absent #---------------------------------------------------------- -- name: create a vpn-tunnel - gcp_compute_vpn-tunnel: +- name: create a vpn tunnel + gcp_compute_vpn_tunnel: name: "{{ resource_name }}" region: us-west1 target_vpn_gateway: "{{ gateway }}" @@ -94,8 +94,8 @@ that: - results['resources'] | length == 1 # ---------------------------------------------------------------------------- -- name: create a vpn-tunnel that already exists - gcp_compute_vpn-tunnel: +- name: create a vpn tunnel that already exists + gcp_compute_vpn_tunnel: name: "{{ resource_name }}" region: us-west1 target_vpn_gateway: "{{ gateway }}" @@ -112,8 +112,8 @@ - result.changed == false - "result.kind == 'compute#vpnTunnel'" #---------------------------------------------------------- -- name: delete a vpn-tunnel - gcp_compute_vpn-tunnel: +- name: delete a vpn tunnel + gcp_compute_vpn_tunnel: name: "{{ resource_name }}" region: us-west1 target_vpn_gateway: "{{ gateway }}" @@ -145,8 +145,8 @@ that: - results['resources'] | length == 0 # ---------------------------------------------------------------------------- -- name: delete a vpn-tunnel that does not exist - gcp_compute_vpn-tunnel: +- name: delete a vpn tunnel that does not exist + gcp_compute_vpn_tunnel: name: "{{ resource_name }}" region: us-west1 target_vpn_gateway: "{{ gateway }}" diff --git a/tests/integration/gcp_iam_service_account/tasks/main.yml b/tests/integration/gcp_iam_service_account/tasks/main.yml index 519df9937f3b9a..2e06eb7f5d9cef 100644 --- a/tests/integration/gcp_iam_service_account/tasks/main.yml +++ b/tests/integration/gcp_iam_service_account/tasks/main.yml @@ -15,7 +15,9 @@ # Pre-test setup - name: delete a service account gcp_iam_service_account: - name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com + name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" + + ' display_name: My Ansible test key project: "{{ gcp_project }}" auth_kind: "{{ gcp_cred_kind }}" @@ -24,7 +26,9 @@ #---------------------------------------------------------- - name: create a service account gcp_iam_service_account: - name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com + name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" + + ' display_name: My Ansible test key project: "{{ gcp_project }}" auth_kind: "{{ gcp_cred_kind }}" @@ -50,7 +54,9 @@ # ---------------------------------------------------------------------------- - name: create a service account that already exists gcp_iam_service_account: - name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com + name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" + + ' display_name: My Ansible test key project: "{{ gcp_project }}" auth_kind: "{{ gcp_cred_kind }}" @@ -64,7 +70,9 @@ #---------------------------------------------------------- - name: delete a service account gcp_iam_service_account: - name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com + name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" + + ' display_name: My Ansible test key project: "{{ gcp_project }}" auth_kind: "{{ gcp_cred_kind }}" @@ -90,7 +98,9 @@ # ---------------------------------------------------------------------------- - name: delete a service account that does not exist gcp_iam_service_account: - name: test-ansible@graphite-playground.google.com.iam.gserviceaccount.com + name: '"{{resource_name}}@{{gcp_project}}.google.com.iam.gserviceaccount.com" + + ' display_name: My Ansible test key project: "{{ gcp_project }}" auth_kind: "{{ gcp_cred_kind }}" diff --git a/tests/integration/gcp_sql_database/tasks/main.yml b/tests/integration/gcp_sql_database/tasks/main.yml index 5bbfc6225665c2..4f73c1ca755c9d 100644 --- a/tests/integration/gcp_sql_database/tasks/main.yml +++ b/tests/integration/gcp_sql_database/tasks/main.yml @@ -15,7 +15,7 @@ # Pre-test setup - name: create a instance gcp_sql_instance: - name: "{{ resource_name }}" + name: "{{resource_name}}-3" settings: ip_configuration: authorized_networks: @@ -132,7 +132,7 @@ # If errors happen, don't crash the playbook! - name: delete a instance gcp_sql_instance: - name: "{{ resource_name }}" + name: "{{resource_name}}-3" settings: ip_configuration: authorized_networks: diff --git a/tests/integration/gcp_sql_instance/tasks/main.yml b/tests/integration/gcp_sql_instance/tasks/main.yml index eace727c02f39b..fa7690c1e80c11 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 48f47654861288..b566961298114e 100644 --- a/tests/integration/gcp_sql_user/tasks/main.yml +++ b/tests/integration/gcp_sql_user/tasks/main.yml @@ -15,7 +15,7 @@ # Pre-test setup - name: create a instance gcp_sql_instance: - name: "{{ resource_name }}" + name: "{{resource_name}}-1" settings: ip_configuration: authorized_networks: @@ -137,7 +137,7 @@ # If errors happen, don't crash the playbook! - name: delete a instance gcp_sql_instance: - name: "{{ resource_name }}" + name: "{{resource_name}}-1" settings: ip_configuration: authorized_networks: 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 52c63b638a6420..d2fc765bf0adf9 100644 --- a/tests/integration/gcp_storage_bucket_access_control/tasks/main.yml +++ b/tests/integration/gcp_storage_bucket_access_control/tasks/main.yml @@ -15,11 +15,11 @@ # 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: @@ -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