diff options
Diffstat (limited to 'collections-debian-merged/ansible_collections/google/cloud/tests/integration')
437 files changed, 13320 insertions, 0 deletions
diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/tasks/autogen.yml new file mode 100644 index 00000000..561d5c6e --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/tasks/autogen.yml @@ -0,0 +1,108 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a firewall rule + google.cloud.gcp_appengine_firewall_rule: + priority: 1000 + source_range: 10.0.0.0 + action: ALLOW + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a firewall rule + google.cloud.gcp_appengine_firewall_rule: + priority: 1000 + source_range: 10.0.0.0 + action: ALLOW + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that firewall_rule was created + google.cloud.gcp_appengine_firewall_rule_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length >= 1 +# ---------------------------------------------------------------------------- +- name: create a firewall rule that already exists + google.cloud.gcp_appengine_firewall_rule: + priority: 1000 + source_range: 10.0.0.0 + action: ALLOW + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a firewall rule + google.cloud.gcp_appengine_firewall_rule: + priority: 1000 + source_range: 10.0.0.0 + action: ALLOW + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that firewall_rule was deleted + google.cloud.gcp_appengine_firewall_rule_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a firewall rule that does not exist + google.cloud.gcp_appengine_firewall_rule: + priority: 1000 + source_range: 10.0.0.0 + action: ALLOW + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_appengine_firewall_rule/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/tasks/autogen.yml new file mode 100644 index 00000000..ce137d35 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/tasks/autogen.yml @@ -0,0 +1,108 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a dataset + google.cloud.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: create a dataset + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that dataset was created + google.cloud.gcp_bigquery_dataset_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/bigquery + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='datasetReference') | map(attribute='datasetId') | select("match", ".*my_example_dataset.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a dataset that already exists + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a dataset + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that dataset was deleted + google.cloud.gcp_bigquery_dataset_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/bigquery + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='datasetReference') | map(attribute='datasetId') | select("match", ".*my_example_dataset.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a dataset that does not exist + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_dataset/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/tasks/autogen.yml new file mode 100644 index 00000000..a579d395 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/tasks/autogen.yml @@ -0,0 +1,149 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a dataset + google.cloud.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 + register: dataset +- name: delete a table + google.cloud.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: create a table + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that table was created + google.cloud.gcp_bigquery_table_info: + dataset: example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/bigquery + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='tableReference') | map(attribute='tableId') | select("match", ".*example_table.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a table that already exists + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a table + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that table was deleted + google.cloud.gcp_bigquery_table_info: + dataset: example_dataset + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/bigquery + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='tableReference') | map(attribute='tableId') | select("match", ".*example_table.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a table that does not exist + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a dataset + google.cloud.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 + register: dataset + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigquery_table/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/tasks/autogen.yml new file mode 100644 index 00000000..b9bec87a --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/tasks/autogen.yml @@ -0,0 +1,123 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a instance + google.cloud.gcp_bigtable_instance: + name: my-instance + display_name: My Test Cluster + clusters: + - name: mycluster + location: projects/{{ gcp_project }}/locations/us-central1-a + serve_nodes: 1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a instance + google.cloud.gcp_bigtable_instance: + name: my-instance + display_name: My Test Cluster + clusters: + - name: mycluster + location: projects/{{ gcp_project }}/locations/us-central1-a + serve_nodes: 1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that instance was created + google.cloud.gcp_bigtable_instance_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/bigtable + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*my-instance.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a instance that already exists + google.cloud.gcp_bigtable_instance: + name: my-instance + display_name: My Test Cluster + clusters: + - name: mycluster + location: projects/{{ gcp_project }}/locations/us-central1-a + serve_nodes: 1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a instance + google.cloud.gcp_bigtable_instance: + name: my-instance + display_name: My Test Cluster + clusters: + - name: mycluster + location: projects/{{ gcp_project }}/locations/us-central1-a + serve_nodes: 1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that instance was deleted + google.cloud.gcp_bigtable_instance_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/bigtable + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*my-instance.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a instance that does not exist + google.cloud.gcp_bigtable_instance: + name: my-instance + display_name: My Test Cluster + clusters: + - name: mycluster + location: projects/{{ gcp_project }}/locations/us-central1-a + serve_nodes: 1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_bigtable_instance/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudbuild_trigger/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudbuild_trigger/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudbuild_trigger/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudbuild_trigger/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudbuild_trigger/defaults/main.yml new file mode 100644 index 00000000..aa87a2a8 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudbuild_trigger/defaults/main.yml @@ -0,0 +1,3 @@ +--- +# defaults file +resource_name: '{{resource_prefix}}' diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudbuild_trigger/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudbuild_trigger/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudbuild_trigger/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/tasks/autogen.yml new file mode 100644 index 00000000..95a308a8 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/tasks/autogen.yml @@ -0,0 +1,120 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a cloud function + google.cloud.gcp_cloudfunctions_cloud_function: + name: "{{ resource_name }}" + location: us-central1 + entry_point: helloGET + source_archive_url: gs://ansible-cloudfunctions-bucket/function.zip + trigger_http: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a cloud function + google.cloud.gcp_cloudfunctions_cloud_function: + name: "{{ resource_name }}" + location: us-central1 + entry_point: helloGET + source_archive_url: gs://ansible-cloudfunctions-bucket/function.zip + trigger_http: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that cloud_function was created + google.cloud.gcp_cloudfunctions_cloud_function_info: + location: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a cloud function that already exists + google.cloud.gcp_cloudfunctions_cloud_function: + name: "{{ resource_name }}" + location: us-central1 + entry_point: helloGET + source_archive_url: gs://ansible-cloudfunctions-bucket/function.zip + trigger_http: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a cloud function + google.cloud.gcp_cloudfunctions_cloud_function: + name: "{{ resource_name }}" + location: us-central1 + entry_point: helloGET + source_archive_url: gs://ansible-cloudfunctions-bucket/function.zip + trigger_http: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that cloud_function was deleted + google.cloud.gcp_cloudfunctions_cloud_function_info: + location: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a cloud function that does not exist + google.cloud.gcp_cloudfunctions_cloud_function: + name: "{{ resource_name }}" + location: us-central1 + entry_point: helloGET + source_archive_url: gs://ansible-cloudfunctions-bucket/function.zip + trigger_http: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudfunctions_cloud_function/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/tasks/autogen.yml new file mode 100644 index 00000000..18773dd6 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/tasks/autogen.yml @@ -0,0 +1,160 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a job + google.cloud.gcp_cloudscheduler_job: + name: job + region: us-central1 + schedule: "*/4 * * * *" + description: test app engine job + time_zone: Europe/London + attempt_deadline: 320s + app_engine_http_target: + http_method: POST + app_engine_routing: + service: web + version: prod + instance: my-instance-001 + relative_uri: "/ping" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a job + google.cloud.gcp_cloudscheduler_job: + name: job + region: us-central1 + schedule: "*/4 * * * *" + description: test app engine job + time_zone: Europe/London + attempt_deadline: 320s + app_engine_http_target: + http_method: POST + app_engine_routing: + service: web + version: prod + instance: my-instance-001 + relative_uri: "/ping" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that job was created + google.cloud.gcp_cloudscheduler_job_info: + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*job.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a job that already exists + google.cloud.gcp_cloudscheduler_job: + name: job + region: us-central1 + schedule: "*/4 * * * *" + description: test app engine job + time_zone: Europe/London + attempt_deadline: 320s + app_engine_http_target: + http_method: POST + app_engine_routing: + service: web + version: prod + instance: my-instance-001 + relative_uri: "/ping" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a job + google.cloud.gcp_cloudscheduler_job: + name: job + region: us-central1 + schedule: "*/4 * * * *" + description: test app engine job + time_zone: Europe/London + attempt_deadline: 320s + app_engine_http_target: + http_method: POST + app_engine_routing: + service: web + version: prod + instance: my-instance-001 + relative_uri: "/ping" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that job was deleted + google.cloud.gcp_cloudscheduler_job_info: + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*job.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a job that does not exist + google.cloud.gcp_cloudscheduler_job: + name: job + region: us-central1 + schedule: "*/4 * * * *" + description: test app engine job + time_zone: Europe/London + attempt_deadline: 320s + app_engine_http_target: + http_method: POST + app_engine_routing: + service: web + version: prod + instance: my-instance-001 + relative_uri: "/ping" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudscheduler_job/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/tasks/autogen.yml new file mode 100644 index 00000000..1fe823e4 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/tasks/autogen.yml @@ -0,0 +1,105 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a queue + google.cloud.gcp_cloudtasks_queue: + name: "{{ resource_name }}" + location: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a queue + google.cloud.gcp_cloudtasks_queue: + name: "{{ resource_name }}" + location: 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: + that: + - result.changed == true +- name: verify that queue was created + google.cloud.gcp_cloudtasks_queue_info: + location: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a queue that already exists + google.cloud.gcp_cloudtasks_queue: + name: "{{ resource_name }}" + location: 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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a queue + google.cloud.gcp_cloudtasks_queue: + name: "{{ resource_name }}" + location: 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: + that: + - result.changed == true +- name: verify that queue was deleted + google.cloud.gcp_cloudtasks_queue_info: + location: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a queue that does not exist + google.cloud.gcp_cloudtasks_queue: + name: "{{ resource_name }}" + location: 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: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_cloudtasks_queue/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/tasks/autogen.yml new file mode 100644 index 00000000..cf24c9d7 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/tasks/autogen.yml @@ -0,0 +1,109 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a address + google.cloud.gcp_compute_address: + name: test-address1 + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a address + google.cloud.gcp_compute_address: + name: test-address1 + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that address was created + google.cloud.gcp_compute_address_info: + filters: + - name = test-address1 + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a address that already exists + google.cloud.gcp_compute_address: + name: test-address1 + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a address + google.cloud.gcp_compute_address: + name: test-address1 + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that address was deleted + google.cloud.gcp_compute_address_info: + filters: + - name = test-address1 + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a address that does not exist + google.cloud.gcp_compute_address: + name: test-address1 + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_address/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/tasks/autogen.yml new file mode 100644 index 00000000..4d6cc419 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/tasks/autogen.yml @@ -0,0 +1,251 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a network + google.cloud.gcp_compute_network: + name: network-instancetemplate + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: network +- name: create a address + google.cloud.gcp_compute_address: + name: address-instancetemplate + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: address +- name: create a instance template + google.cloud.gcp_compute_instance_template: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: instancetemplate +- name: create a instance group manager + google.cloud.gcp_compute_instance_group_manager: + name: "{{ resource_name }}" + base_instance_name: test1-child + instance_template: "{{ instancetemplate }}" + target_size: 3 + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: igm +- name: delete a autoscaler + google.cloud.gcp_compute_autoscaler: + name: "{{ resource_name }}" + zone: us-central1-a + target: "{{ igm }}" + autoscaling_policy: + max_num_replicas: 5 + min_num_replicas: 1 + cool_down_period_sec: 60 + cpu_utilization: + utilization_target: 0.5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a autoscaler + google.cloud.gcp_compute_autoscaler: + name: "{{ resource_name }}" + zone: us-central1-a + target: "{{ igm }}" + autoscaling_policy: + max_num_replicas: 5 + min_num_replicas: 1 + cool_down_period_sec: 60 + cpu_utilization: + utilization_target: 0.5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that autoscaler was created + google.cloud.gcp_compute_autoscaler_info: + filters: + - name = {{ resource_name }} + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a autoscaler that already exists + google.cloud.gcp_compute_autoscaler: + name: "{{ resource_name }}" + zone: us-central1-a + target: "{{ igm }}" + autoscaling_policy: + max_num_replicas: 5 + min_num_replicas: 1 + cool_down_period_sec: 60 + cpu_utilization: + utilization_target: 0.5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a autoscaler + google.cloud.gcp_compute_autoscaler: + name: "{{ resource_name }}" + zone: us-central1-a + target: "{{ igm }}" + autoscaling_policy: + max_num_replicas: 5 + min_num_replicas: 1 + cool_down_period_sec: 60 + cpu_utilization: + utilization_target: 0.5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that autoscaler was deleted + google.cloud.gcp_compute_autoscaler_info: + filters: + - name = {{ resource_name }} + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a autoscaler that does not exist + google.cloud.gcp_compute_autoscaler: + name: "{{ resource_name }}" + zone: us-central1-a + target: "{{ igm }}" + autoscaling_policy: + max_num_replicas: 5 + min_num_replicas: 1 + cool_down_period_sec: 60 + cpu_utilization: + utilization_target: 0.5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a instance group manager + google.cloud.gcp_compute_instance_group_manager: + name: "{{ resource_name }}" + base_instance_name: test1-child + instance_template: "{{ instancetemplate }}" + target_size: 3 + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: igm + ignore_errors: true +- name: delete a instance template + google.cloud.gcp_compute_instance_template: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: instancetemplate + ignore_errors: true +- name: delete a address + google.cloud.gcp_compute_address: + name: address-instancetemplate + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: address + ignore_errors: true +- name: delete a network + google.cloud.gcp_compute_network: + name: network-instancetemplate + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: network + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_autoscaler/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/tasks/autogen.yml new file mode 100644 index 00000000..5b0639d0 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/tasks/autogen.yml @@ -0,0 +1,137 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a bucket + google.cloud.gcp_storage_bucket: + name: bucket-backendbucket + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: bucket +- name: delete a backend bucket + google.cloud.gcp_compute_backend_bucket: + name: "{{ resource_name }}" + bucket_name: "{{ bucket.name }}" + description: A BackendBucket to connect LNB w/ Storage Bucket + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a backend bucket + google.cloud.gcp_compute_backend_bucket: + name: "{{ resource_name }}" + bucket_name: "{{ bucket.name }}" + description: A BackendBucket to connect LNB w/ Storage Bucket + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that backend_bucket was created + google.cloud.gcp_compute_backend_bucket_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a backend bucket that already exists + google.cloud.gcp_compute_backend_bucket: + name: "{{ resource_name }}" + bucket_name: "{{ bucket.name }}" + description: A BackendBucket to connect LNB w/ Storage Bucket + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a backend bucket + google.cloud.gcp_compute_backend_bucket: + name: "{{ resource_name }}" + bucket_name: "{{ bucket.name }}" + description: A BackendBucket to connect LNB w/ Storage Bucket + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that backend_bucket was deleted + google.cloud.gcp_compute_backend_bucket_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a backend bucket that does not exist + google.cloud.gcp_compute_backend_bucket: + name: "{{ resource_name }}" + bucket_name: "{{ bucket.name }}" + description: A BackendBucket to connect LNB w/ Storage Bucket + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a bucket + google.cloud.gcp_storage_bucket: + name: bucket-backendbucket + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: bucket + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_bucket/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/tasks/autogen.yml new file mode 100644 index 00000000..703134c8 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/tasks/autogen.yml @@ -0,0 +1,174 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-backendservice + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: instancegroup +- name: create a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: httphealthcheck-backendservice + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: healthcheck +- name: delete a backend service + google.cloud.gcp_compute_backend_service: + name: "{{ resource_name }}" + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a backend service + google.cloud.gcp_compute_backend_service: + name: "{{ resource_name }}" + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that backend_service was created + google.cloud.gcp_compute_backend_service_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a backend service that already exists + google.cloud.gcp_compute_backend_service: + name: "{{ resource_name }}" + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a backend service + google.cloud.gcp_compute_backend_service: + name: "{{ resource_name }}" + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that backend_service was deleted + google.cloud.gcp_compute_backend_service_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a backend service that does not exist + google.cloud.gcp_compute_backend_service: + name: "{{ resource_name }}" + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: httphealthcheck-backendservice + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: healthcheck + ignore_errors: true +- name: delete a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-backendservice + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: instancegroup + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_backend_service/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/tasks/autogen.yml new file mode 100644 index 00000000..07a62ca1 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/tasks/autogen.yml @@ -0,0 +1,124 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a disk + google.cloud.gcp_compute_disk: + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a disk + google.cloud.gcp_compute_disk: + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + zone: 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: + that: + - result.changed == true +- name: verify that disk was created + google.cloud.gcp_compute_disk_info: + filters: + - name = {{ resource_name }} + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a disk that already exists + google.cloud.gcp_compute_disk: + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + zone: 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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a disk + google.cloud.gcp_compute_disk: + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + zone: 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: + that: + - result.changed == true +- name: verify that disk was deleted + google.cloud.gcp_compute_disk_info: + filters: + - name = {{ resource_name }} + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a disk that does not exist + google.cloud.gcp_compute_disk: + name: "{{ resource_name }}" + size_gb: 50 + disk_encryption_key: + raw_key: SGVsbG8gZnJvbSBHb29nbGUgQ2xvdWQgUGxhdGZvcm0= + zone: 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: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_disk/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/tasks/autogen.yml new file mode 100644 index 00000000..094b45bb --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/tasks/autogen.yml @@ -0,0 +1,127 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a external vpn gateway + google.cloud.gcp_compute_external_vpn_gateway: + name: "{{ resource_name }}" + redundancy_type: SINGLE_IP_INTERNALLY_REDUNDANT + descrpition: An externalyl managed VPN gateway + interfaces: + - id: 0 + ip_address: 8.8.8.8 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a external vpn gateway + google.cloud.gcp_compute_external_vpn_gateway: + name: "{{ resource_name }}" + redundancy_type: SINGLE_IP_INTERNALLY_REDUNDANT + descrpition: An externalyl managed VPN gateway + interfaces: + - id: 0 + ip_address: 8.8.8.8 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that external_vpn_gateway was created + google.cloud.gcp_compute_external_vpn_gateway_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a external vpn gateway that already exists + google.cloud.gcp_compute_external_vpn_gateway: + name: "{{ resource_name }}" + redundancy_type: SINGLE_IP_INTERNALLY_REDUNDANT + descrpition: An externalyl managed VPN gateway + interfaces: + - id: 0 + ip_address: 8.8.8.8 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a external vpn gateway + google.cloud.gcp_compute_external_vpn_gateway: + name: "{{ resource_name }}" + redundancy_type: SINGLE_IP_INTERNALLY_REDUNDANT + descrpition: An externalyl managed VPN gateway + interfaces: + - id: 0 + ip_address: 8.8.8.8 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that external_vpn_gateway was deleted + google.cloud.gcp_compute_external_vpn_gateway_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a external vpn gateway that does not exist + google.cloud.gcp_compute_external_vpn_gateway: + name: "{{ resource_name }}" + redundancy_type: SINGLE_IP_INTERNALLY_REDUNDANT + descrpition: An externalyl managed VPN gateway + interfaces: + - id: 0 + ip_address: 8.8.8.8 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_external_vpn_gateway/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/tasks/autogen.yml new file mode 100644 index 00000000..e8448709 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/tasks/autogen.yml @@ -0,0 +1,147 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a firewall + google.cloud.gcp_compute_firewall: + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a firewall + google.cloud.gcp_compute_firewall: + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that firewall was created + google.cloud.gcp_compute_firewall_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a firewall that already exists + google.cloud.gcp_compute_firewall: + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a firewall + google.cloud.gcp_compute_firewall: + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that firewall was deleted + google.cloud.gcp_compute_firewall_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a firewall that does not exist + google.cloud.gcp_compute_firewall: + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/tasks/main.yml new file mode 100644 index 00000000..3cfb1cb1 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/tasks/main.yml @@ -0,0 +1,3 @@ +--- +- include_tasks: update.yml +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/tasks/update.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/tasks/update.yml new file mode 100644 index 00000000..3ebbd21d --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_firewall/tasks/update.yml @@ -0,0 +1,179 @@ +# Copyright 2019 Google Inc. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a firewall + google.cloud.gcp_compute_firewall: + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a firewall + google.cloud.gcp_compute_firewall: + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that firewall was created + google.cloud.gcp_compute_firewall_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: update the firewall + google.cloud.gcp_compute_firewall: + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '55' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +# ---------------------------------------------------------------------------- +- name: check firewall was updated. + google.cloud.gcp_compute_firewall_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +- name: verify that update succeeded + assert: + that: + - results['resources'][0]['allowed'][0]['ports'][0] == '55' +#---------------------------------------------------------- +- name: delete a firewall + google.cloud.gcp_compute_firewall: + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that firewall was deleted + google.cloud.gcp_compute_firewall_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a firewall that does not exist + google.cloud.gcp_compute_firewall: + name: "{{ resource_name }}" + allowed: + - ip_protocol: tcp + ports: + - '22' + target_tags: + - test-ssh-server + - staging-ssh-server + source_tags: + - test-ssh-clients + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/tasks/autogen.yml new file mode 100644 index 00000000..255f23df --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/tasks/autogen.yml @@ -0,0 +1,170 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a address + google.cloud.gcp_compute_address: + name: address-forwardingrule + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: address +- name: create a target pool + google.cloud.gcp_compute_target_pool: + name: targetpool-forwardingrule + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: targetpool +- name: delete a forwarding rule + google.cloud.gcp_compute_forwarding_rule: + name: "{{ resource_name }}" + region: us-west1 + target: "{{ targetpool }}" + ip_protocol: TCP + port_range: 80-80 + ip_address: "{{ address.address }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a forwarding rule + google.cloud.gcp_compute_forwarding_rule: + name: "{{ resource_name }}" + region: us-west1 + target: "{{ targetpool }}" + ip_protocol: TCP + port_range: 80-80 + ip_address: "{{ address.address }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that forwarding_rule was created + google.cloud.gcp_compute_forwarding_rule_info: + filters: + - name = {{ resource_name }} + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a forwarding rule that already exists + google.cloud.gcp_compute_forwarding_rule: + name: "{{ resource_name }}" + region: us-west1 + target: "{{ targetpool }}" + ip_protocol: TCP + port_range: 80-80 + ip_address: "{{ address.address }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a forwarding rule + google.cloud.gcp_compute_forwarding_rule: + name: "{{ resource_name }}" + region: us-west1 + target: "{{ targetpool }}" + ip_protocol: TCP + port_range: 80-80 + ip_address: "{{ address.address }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that forwarding_rule was deleted + google.cloud.gcp_compute_forwarding_rule_info: + filters: + - name = {{ resource_name }} + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a forwarding rule that does not exist + google.cloud.gcp_compute_forwarding_rule: + name: "{{ resource_name }}" + region: us-west1 + target: "{{ targetpool }}" + ip_protocol: TCP + port_range: 80-80 + ip_address: "{{ address.address }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a target pool + google.cloud.gcp_compute_target_pool: + name: targetpool-forwardingrule + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: targetpool + ignore_errors: true +- name: delete a address + google.cloud.gcp_compute_address: + name: address-forwardingrule + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: address + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_forwarding_rule/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/tasks/autogen.yml new file mode 100644 index 00000000..38ab68f7 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/tasks/autogen.yml @@ -0,0 +1,102 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a global address + google.cloud.gcp_compute_global_address: + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a global address + google.cloud.gcp_compute_global_address: + name: "{{ 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: + that: + - result.changed == true +- name: verify that global_address was created + google.cloud.gcp_compute_global_address_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a global address that already exists + google.cloud.gcp_compute_global_address: + name: "{{ 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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a global address + google.cloud.gcp_compute_global_address: + name: "{{ 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: + that: + - result.changed == true +- name: verify that global_address was deleted + google.cloud.gcp_compute_global_address_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a global address that does not exist + google.cloud.gcp_compute_global_address: + name: "{{ 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: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_address/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/tasks/autogen.yml new file mode 100644 index 00000000..0e878219 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/tasks/autogen.yml @@ -0,0 +1,251 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a global address + google.cloud.gcp_compute_global_address: + name: globaladdress-globalforwardingrule + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: globaladdress +- name: create a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-globalforwardingrule + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: instancegroup +- name: create a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: httphealthcheck-globalforwardingrule + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: healthcheck +- name: create a backend service + google.cloud.gcp_compute_backend_service: + name: backendservice-globalforwardingrule + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: backendservice +- name: create a URL map + google.cloud.gcp_compute_url_map: + name: urlmap-globalforwardingrule + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: urlmap +- name: create a target HTTP proxy + google.cloud.gcp_compute_target_http_proxy: + name: targethttpproxy-globalforwardingrule + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: httpproxy +- name: delete a global forwarding rule + google.cloud.gcp_compute_global_forwarding_rule: + name: "{{ resource_name }}" + ip_address: "{{ globaladdress.address }}" + ip_protocol: TCP + port_range: 80-80 + target: "{{ httpproxy.selfLink }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a global forwarding rule + google.cloud.gcp_compute_global_forwarding_rule: + name: "{{ resource_name }}" + ip_address: "{{ globaladdress.address }}" + ip_protocol: TCP + port_range: 80-80 + target: "{{ httpproxy.selfLink }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that global_forwarding_rule was created + google.cloud.gcp_compute_global_forwarding_rule_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a global forwarding rule that already exists + google.cloud.gcp_compute_global_forwarding_rule: + name: "{{ resource_name }}" + ip_address: "{{ globaladdress.address }}" + ip_protocol: TCP + port_range: 80-80 + target: "{{ httpproxy.selfLink }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a global forwarding rule + google.cloud.gcp_compute_global_forwarding_rule: + name: "{{ resource_name }}" + ip_address: "{{ globaladdress.address }}" + ip_protocol: TCP + port_range: 80-80 + target: "{{ httpproxy.selfLink }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that global_forwarding_rule was deleted + google.cloud.gcp_compute_global_forwarding_rule_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a global forwarding rule that does not exist + google.cloud.gcp_compute_global_forwarding_rule: + name: "{{ resource_name }}" + ip_address: "{{ globaladdress.address }}" + ip_protocol: TCP + port_range: 80-80 + target: "{{ httpproxy.selfLink }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a target HTTP proxy + google.cloud.gcp_compute_target_http_proxy: + name: targethttpproxy-globalforwardingrule + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: httpproxy + ignore_errors: true +- name: delete a URL map + google.cloud.gcp_compute_url_map: + name: urlmap-globalforwardingrule + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: urlmap + ignore_errors: true +- name: delete a backend service + google.cloud.gcp_compute_backend_service: + name: backendservice-globalforwardingrule + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: backendservice + ignore_errors: true +- name: delete a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: httphealthcheck-globalforwardingrule + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: healthcheck + ignore_errors: true +- name: delete a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-globalforwardingrule + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: instancegroup + ignore_errors: true +- name: delete a global address + google.cloud.gcp_compute_global_address: + name: globaladdress-globalforwardingrule + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: globaladdress + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_global_forwarding_rule/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/tasks/autogen.yml new file mode 100644 index 00000000..c8c4535d --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/tasks/autogen.yml @@ -0,0 +1,142 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a health check + google.cloud.gcp_compute_health_check: + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a health check + google.cloud.gcp_compute_health_check: + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that health_check was created + google.cloud.gcp_compute_health_check_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a health check that already exists + google.cloud.gcp_compute_health_check: + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a health check + google.cloud.gcp_compute_health_check: + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that health_check was deleted + google.cloud.gcp_compute_health_check_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a health check that does not exist + google.cloud.gcp_compute_health_check: + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_health_check/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/tasks/autogen.yml new file mode 100644 index 00000000..ee87f79b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/tasks/autogen.yml @@ -0,0 +1,122 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: "{{ resource_name }}" + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: "{{ resource_name }}" + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that http_health_check was created + google.cloud.gcp_compute_http_health_check_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a HTTP health check that already exists + google.cloud.gcp_compute_http_health_check: + name: "{{ resource_name }}" + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: "{{ resource_name }}" + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that http_health_check was deleted + google.cloud.gcp_compute_http_health_check_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a HTTP health check that does not exist + google.cloud.gcp_compute_http_health_check: + name: "{{ resource_name }}" + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_http_health_check/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/tasks/autogen.yml new file mode 100644 index 00000000..5554c368 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/tasks/autogen.yml @@ -0,0 +1,122 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a HTTPS health check + google.cloud.gcp_compute_https_health_check: + name: "{{ resource_name }}" + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a HTTPS health check + google.cloud.gcp_compute_https_health_check: + name: "{{ resource_name }}" + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that https_health_check was created + google.cloud.gcp_compute_https_health_check_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a HTTPS health check that already exists + google.cloud.gcp_compute_https_health_check: + name: "{{ resource_name }}" + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a HTTPS health check + google.cloud.gcp_compute_https_health_check: + name: "{{ resource_name }}" + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that https_health_check was deleted + google.cloud.gcp_compute_https_health_check_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a HTTPS health check that does not exist + google.cloud.gcp_compute_https_health_check: + name: "{{ resource_name }}" + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_https_health_check/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/tasks/autogen.yml new file mode 100644 index 00000000..a33dda8e --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/tasks/autogen.yml @@ -0,0 +1,129 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a disk + google.cloud.gcp_compute_disk: + name: disk-image + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: disk +- name: delete a image + google.cloud.gcp_compute_image: + name: "{{ resource_name }}" + source_disk: "{{ disk }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a image + google.cloud.gcp_compute_image: + name: "{{ resource_name }}" + source_disk: "{{ disk }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that image was created + google.cloud.gcp_compute_image_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a image that already exists + google.cloud.gcp_compute_image: + name: "{{ resource_name }}" + source_disk: "{{ disk }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a image + google.cloud.gcp_compute_image: + name: "{{ resource_name }}" + source_disk: "{{ disk }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that image was deleted + google.cloud.gcp_compute_image_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a image that does not exist + google.cloud.gcp_compute_image: + name: "{{ resource_name }}" + source_disk: "{{ disk }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a disk + google.cloud.gcp_compute_disk: + name: disk-image + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: disk + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_image/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/tasks/autogen.yml new file mode 100644 index 00000000..1e3c2597 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/tasks/autogen.yml @@ -0,0 +1,276 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a disk + google.cloud.gcp_compute_disk: + name: disk-instance + size_gb: 50 + source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: disk +- name: create a network + google.cloud.gcp_compute_network: + name: network-instance + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: network +- name: create a address + google.cloud.gcp_compute_address: + name: address-instance + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: address +- name: delete a instance + google.cloud.gcp_compute_instance: + name: "{{ resource_name }}" + machine_type: n1-standard-1 + disks: + - auto_delete: 'true' + boot: 'true' + source: "{{ disk }}" + - auto_delete: 'true' + interface: NVME + type: SCRATCH + initialize_params: + disk_type: local-ssd + metadata: + startup-script-url: gs:://graphite-playground/bootstrap.sh + cost-center: '12345' + labels: + environment: production + network_interfaces: + - network: "{{ network }}" + access_configs: + - name: External NAT + nat_ip: "{{ address }}" + type: ONE_TO_ONE_NAT + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a instance + google.cloud.gcp_compute_instance: + name: "{{ resource_name }}" + machine_type: n1-standard-1 + disks: + - auto_delete: 'true' + boot: 'true' + source: "{{ disk }}" + - auto_delete: 'true' + interface: NVME + type: SCRATCH + initialize_params: + disk_type: local-ssd + metadata: + startup-script-url: gs:://graphite-playground/bootstrap.sh + cost-center: '12345' + labels: + environment: production + network_interfaces: + - network: "{{ network }}" + access_configs: + - name: External NAT + nat_ip: "{{ address }}" + type: ONE_TO_ONE_NAT + zone: 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: + that: + - result.changed == true +- name: verify that instance was created + google.cloud.gcp_compute_instance_info: + filters: + - name = {{ resource_name }} + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a instance that already exists + google.cloud.gcp_compute_instance: + name: "{{ resource_name }}" + machine_type: n1-standard-1 + disks: + - auto_delete: 'true' + boot: 'true' + source: "{{ disk }}" + - auto_delete: 'true' + interface: NVME + type: SCRATCH + initialize_params: + disk_type: local-ssd + metadata: + startup-script-url: gs:://graphite-playground/bootstrap.sh + cost-center: '12345' + labels: + environment: production + network_interfaces: + - network: "{{ network }}" + access_configs: + - name: External NAT + nat_ip: "{{ address }}" + type: ONE_TO_ONE_NAT + zone: 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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a instance + google.cloud.gcp_compute_instance: + name: "{{ resource_name }}" + machine_type: n1-standard-1 + disks: + - auto_delete: 'true' + boot: 'true' + source: "{{ disk }}" + - auto_delete: 'true' + interface: NVME + type: SCRATCH + initialize_params: + disk_type: local-ssd + metadata: + startup-script-url: gs:://graphite-playground/bootstrap.sh + cost-center: '12345' + labels: + environment: production + network_interfaces: + - network: "{{ network }}" + access_configs: + - name: External NAT + nat_ip: "{{ address }}" + type: ONE_TO_ONE_NAT + zone: 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: + that: + - result.changed == true +- name: verify that instance was deleted + google.cloud.gcp_compute_instance_info: + filters: + - name = {{ resource_name }} + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a instance that does not exist + google.cloud.gcp_compute_instance: + name: "{{ resource_name }}" + machine_type: n1-standard-1 + disks: + - auto_delete: 'true' + boot: 'true' + source: "{{ disk }}" + - auto_delete: 'true' + interface: NVME + type: SCRATCH + initialize_params: + disk_type: local-ssd + metadata: + startup-script-url: gs:://graphite-playground/bootstrap.sh + cost-center: '12345' + labels: + environment: production + network_interfaces: + - network: "{{ network }}" + access_configs: + - name: External NAT + nat_ip: "{{ address }}" + type: ONE_TO_ONE_NAT + zone: 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: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a address + google.cloud.gcp_compute_address: + name: address-instance + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: address + ignore_errors: true +- name: delete a network + google.cloud.gcp_compute_network: + name: network-instance + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: network + ignore_errors: true +- name: delete a disk + google.cloud.gcp_compute_disk: + name: disk-instance + size_gb: 50 + source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: disk + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/tasks/autogen.yml new file mode 100644 index 00000000..4a3a92c9 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/tasks/autogen.yml @@ -0,0 +1,149 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a network + google.cloud.gcp_compute_network: + name: network-instancegroup + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: network +- name: delete a instance group + google.cloud.gcp_compute_instance_group: + name: "{{ resource_name }}" + named_ports: + - name: ansible + port: 1234 + network: "{{ network }}" + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a instance group + google.cloud.gcp_compute_instance_group: + name: "{{ resource_name }}" + named_ports: + - name: ansible + port: 1234 + network: "{{ network }}" + zone: 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: + that: + - result.changed == true +- name: verify that instance_group was created + google.cloud.gcp_compute_instance_group_info: + filters: + - name = {{ resource_name }} + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a instance group that already exists + google.cloud.gcp_compute_instance_group: + name: "{{ resource_name }}" + named_ports: + - name: ansible + port: 1234 + network: "{{ network }}" + zone: 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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a instance group + google.cloud.gcp_compute_instance_group: + name: "{{ resource_name }}" + named_ports: + - name: ansible + port: 1234 + network: "{{ network }}" + zone: 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: + that: + - result.changed == true +- name: verify that instance_group was deleted + google.cloud.gcp_compute_instance_group_info: + filters: + - name = {{ resource_name }} + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a instance group that does not exist + google.cloud.gcp_compute_instance_group: + name: "{{ resource_name }}" + named_ports: + - name: ansible + port: 1234 + network: "{{ network }}" + zone: 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: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a network + google.cloud.gcp_compute_network: + name: network-instancegroup + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: network + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/tasks/autogen.yml new file mode 100644 index 00000000..7e56ecf2 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/tasks/autogen.yml @@ -0,0 +1,206 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a network + google.cloud.gcp_compute_network: + name: network-instancetemplate + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: network +- name: create a address + google.cloud.gcp_compute_address: + name: address-instancetemplate + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: address +- name: create a instance template + google.cloud.gcp_compute_instance_template: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: instancetemplate +- name: delete a instance group manager + google.cloud.gcp_compute_instance_group_manager: + name: "{{ resource_name }}" + base_instance_name: test1-child + instance_template: "{{ instancetemplate }}" + target_size: 3 + zone: us-west1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a instance group manager + google.cloud.gcp_compute_instance_group_manager: + name: "{{ resource_name }}" + base_instance_name: test1-child + instance_template: "{{ instancetemplate }}" + target_size: 3 + zone: us-west1-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: + that: + - result.changed == true +- name: verify that instance_group_manager was created + google.cloud.gcp_compute_instance_group_manager_info: + filters: + - name = {{ resource_name }} + zone: us-west1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a instance group manager that already exists + google.cloud.gcp_compute_instance_group_manager: + name: "{{ resource_name }}" + base_instance_name: test1-child + instance_template: "{{ instancetemplate }}" + target_size: 3 + zone: us-west1-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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a instance group manager + google.cloud.gcp_compute_instance_group_manager: + name: "{{ resource_name }}" + base_instance_name: test1-child + instance_template: "{{ instancetemplate }}" + target_size: 3 + zone: us-west1-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: + that: + - result.changed == true +- name: verify that instance_group_manager was deleted + google.cloud.gcp_compute_instance_group_manager_info: + filters: + - name = {{ resource_name }} + zone: us-west1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a instance group manager that does not exist + google.cloud.gcp_compute_instance_group_manager: + name: "{{ resource_name }}" + base_instance_name: test1-child + instance_template: "{{ instancetemplate }}" + target_size: 3 + zone: us-west1-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: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a instance template + google.cloud.gcp_compute_instance_template: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: instancetemplate + ignore_errors: true +- name: delete a address + google.cloud.gcp_compute_address: + name: address-instancetemplate + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: address + ignore_errors: true +- name: delete a network + google.cloud.gcp_compute_network: + name: network-instancetemplate + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: network + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_group_manager/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/tasks/autogen.yml new file mode 100644 index 00000000..d52c6f2a --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/tasks/autogen.yml @@ -0,0 +1,206 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a network + google.cloud.gcp_compute_network: + name: network-instancetemplate + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: network +- name: create a address + google.cloud.gcp_compute_address: + name: address-instancetemplate + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: address +- name: delete a instance template + google.cloud.gcp_compute_instance_template: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a instance template + google.cloud.gcp_compute_instance_template: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that instance_template was created + google.cloud.gcp_compute_instance_template_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a instance template that already exists + google.cloud.gcp_compute_instance_template: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a instance template + google.cloud.gcp_compute_instance_template: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that instance_template was deleted + google.cloud.gcp_compute_instance_template_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a instance template that does not exist + google.cloud.gcp_compute_instance_template: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a address + google.cloud.gcp_compute_address: + name: address-instancetemplate + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: address + ignore_errors: true +- name: delete a network + google.cloud.gcp_compute_network: + name: network-instancetemplate + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: network + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_instance_template/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_interconnect_attachment/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_interconnect_attachment/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_interconnect_attachment/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_interconnect_attachment/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_interconnect_attachment/defaults/main.yml new file mode 100644 index 00000000..aa87a2a8 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_interconnect_attachment/defaults/main.yml @@ -0,0 +1,3 @@ +--- +# defaults file +resource_name: '{{resource_prefix}}' diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_interconnect_attachment/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_interconnect_attachment/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_interconnect_attachment/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_managed_ssl_certificate/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_managed_ssl_certificate/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_managed_ssl_certificate/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_managed_ssl_certificate/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_managed_ssl_certificate/defaults/main.yml new file mode 100644 index 00000000..aa87a2a8 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_managed_ssl_certificate/defaults/main.yml @@ -0,0 +1,3 @@ +--- +# defaults file +resource_name: '{{resource_prefix}}' diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_managed_ssl_certificate/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_managed_ssl_certificate/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_managed_ssl_certificate/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/tasks/autogen.yml new file mode 100644 index 00000000..b3cc90e9 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/tasks/autogen.yml @@ -0,0 +1,107 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a network + google.cloud.gcp_compute_network: + name: "{{ resource_name }}" + auto_create_subnetworks: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a network + google.cloud.gcp_compute_network: + name: "{{ resource_name }}" + auto_create_subnetworks: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that network was created + google.cloud.gcp_compute_network_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a network that already exists + google.cloud.gcp_compute_network: + name: "{{ resource_name }}" + auto_create_subnetworks: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a network + google.cloud.gcp_compute_network: + name: "{{ resource_name }}" + auto_create_subnetworks: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that network was deleted + google.cloud.gcp_compute_network_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a network that does not exist + google.cloud.gcp_compute_network: + name: "{{ resource_name }}" + auto_create_subnetworks: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/tasks/autogen.yml new file mode 100644 index 00000000..6a55923c --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/tasks/autogen.yml @@ -0,0 +1,169 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a network + google.cloud.gcp_compute_network: + name: "{{ resource_name }}" + auto_create_subnetworks: 'false' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: network +- name: create a subnetwork + google.cloud.gcp_compute_subnetwork: + name: "{{ resource_name }}" + ip_cidr_range: 10.0.0.0/16 + region: us-central1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: subnetwork +- name: delete a network endpoint group + google.cloud.gcp_compute_network_endpoint_group: + name: "{{ resource_name }}" + network: "{{ network }}" + subnetwork: "{{ subnetwork }}" + default_port: 90 + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a network endpoint group + google.cloud.gcp_compute_network_endpoint_group: + name: "{{ resource_name }}" + network: "{{ network }}" + subnetwork: "{{ subnetwork }}" + default_port: 90 + zone: 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: + that: + - result.changed == true +- name: verify that network_endpoint_group was created + google.cloud.gcp_compute_network_endpoint_group_info: + filters: + - name = {{ resource_name }} + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a network endpoint group that already exists + google.cloud.gcp_compute_network_endpoint_group: + name: "{{ resource_name }}" + network: "{{ network }}" + subnetwork: "{{ subnetwork }}" + default_port: 90 + zone: 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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a network endpoint group + google.cloud.gcp_compute_network_endpoint_group: + name: "{{ resource_name }}" + network: "{{ network }}" + subnetwork: "{{ subnetwork }}" + default_port: 90 + zone: 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: + that: + - result.changed == true +- name: verify that network_endpoint_group was deleted + google.cloud.gcp_compute_network_endpoint_group_info: + filters: + - name = {{ resource_name }} + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a network endpoint group that does not exist + google.cloud.gcp_compute_network_endpoint_group: + name: "{{ resource_name }}" + network: "{{ network }}" + subnetwork: "{{ subnetwork }}" + default_port: 90 + zone: 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: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a subnetwork + google.cloud.gcp_compute_subnetwork: + name: "{{ resource_name }}" + ip_cidr_range: 10.0.0.0/16 + region: us-central1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: subnetwork + ignore_errors: true +- name: delete a network + google.cloud.gcp_compute_network: + name: "{{ resource_name }}" + auto_create_subnetworks: 'false' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: network + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_network_endpoint_group/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/tasks/autogen.yml new file mode 100644 index 00000000..3a6a6ed1 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/tasks/autogen.yml @@ -0,0 +1,148 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a node template + google.cloud.gcp_compute_node_template: + name: "{{ resource_name }}" + region: us-central1 + node_type: n1-node-96-624 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: node_template +- name: delete a node group + google.cloud.gcp_compute_node_group: + name: "{{ resource_name }}" + zone: us-central1-a + description: example group for ansible + size: 1 + node_template: "{{ node_template }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a node group + google.cloud.gcp_compute_node_group: + name: "{{ resource_name }}" + zone: us-central1-a + description: example group for ansible + size: 1 + node_template: "{{ node_template }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that node_group was created + google.cloud.gcp_compute_node_group_info: + filters: + - name = {{ resource_name }} + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a node group that already exists + google.cloud.gcp_compute_node_group: + name: "{{ resource_name }}" + zone: us-central1-a + description: example group for ansible + size: 1 + node_template: "{{ node_template }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a node group + google.cloud.gcp_compute_node_group: + name: "{{ resource_name }}" + zone: us-central1-a + description: example group for ansible + size: 1 + node_template: "{{ node_template }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that node_group was deleted + google.cloud.gcp_compute_node_group_info: + filters: + - name = {{ resource_name }} + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a node group that does not exist + google.cloud.gcp_compute_node_group: + name: "{{ resource_name }}" + zone: us-central1-a + description: example group for ansible + size: 1 + node_template: "{{ node_template }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a node template + google.cloud.gcp_compute_node_template: + name: "{{ resource_name }}" + region: us-central1 + node_type: n1-node-96-624 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: node_template + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_group/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/tasks/autogen.yml new file mode 100644 index 00000000..09dd3d89 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/tasks/autogen.yml @@ -0,0 +1,114 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a node template + google.cloud.gcp_compute_node_template: + name: "{{ resource_name }}" + region: us-central1 + node_type: n1-node-96-624 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a node template + google.cloud.gcp_compute_node_template: + name: "{{ resource_name }}" + region: us-central1 + node_type: n1-node-96-624 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that node_template was created + google.cloud.gcp_compute_node_template_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a node template that already exists + google.cloud.gcp_compute_node_template: + name: "{{ resource_name }}" + region: us-central1 + node_type: n1-node-96-624 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a node template + google.cloud.gcp_compute_node_template: + name: "{{ resource_name }}" + region: us-central1 + node_type: n1-node-96-624 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that node_template was deleted + google.cloud.gcp_compute_node_template_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a node template that does not exist + google.cloud.gcp_compute_node_template: + name: "{{ resource_name }}" + region: us-central1 + node_type: n1-node-96-624 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_node_template/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/tasks/autogen.yml new file mode 100644 index 00000000..3b924517 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/tasks/autogen.yml @@ -0,0 +1,251 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a network + google.cloud.gcp_compute_network: + name: network-instancetemplate + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: network +- name: create a address + google.cloud.gcp_compute_address: + name: address-instancetemplate + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: address +- name: create a instance template + google.cloud.gcp_compute_instance_template: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: instancetemplate +- name: create a region instance group manager + google.cloud.gcp_compute_region_instance_group_manager: + name: "{{ resource_name }}" + base_instance_name: test1-child + region: us-central1 + instance_template: "{{ instancetemplate }}" + target_size: 3 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: igrm +- name: delete a region autoscaler + google.cloud.gcp_compute_region_autoscaler: + name: my-region-autoscaler + region: us-central1 + autoscaling_policy: + min_num_replicas: 1 + max_num_replicas: 5 + cool_down_period_sec: 60 + cpu_utilization: + utilization_target: 0.5 + target: "{{igrm.selfLink}}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a region autoscaler + google.cloud.gcp_compute_region_autoscaler: + name: my-region-autoscaler + region: us-central1 + autoscaling_policy: + min_num_replicas: 1 + max_num_replicas: 5 + cool_down_period_sec: 60 + cpu_utilization: + utilization_target: 0.5 + target: "{{igrm.selfLink}}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that region_autoscaler was created + google.cloud.gcp_compute_region_autoscaler_info: + filters: + - name = my-region-autoscaler + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a region autoscaler that already exists + google.cloud.gcp_compute_region_autoscaler: + name: my-region-autoscaler + region: us-central1 + autoscaling_policy: + min_num_replicas: 1 + max_num_replicas: 5 + cool_down_period_sec: 60 + cpu_utilization: + utilization_target: 0.5 + target: "{{igrm.selfLink}}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a region autoscaler + google.cloud.gcp_compute_region_autoscaler: + name: my-region-autoscaler + region: us-central1 + autoscaling_policy: + min_num_replicas: 1 + max_num_replicas: 5 + cool_down_period_sec: 60 + cpu_utilization: + utilization_target: 0.5 + target: "{{igrm.selfLink}}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that region_autoscaler was deleted + google.cloud.gcp_compute_region_autoscaler_info: + filters: + - name = my-region-autoscaler + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a region autoscaler that does not exist + google.cloud.gcp_compute_region_autoscaler: + name: my-region-autoscaler + region: us-central1 + autoscaling_policy: + min_num_replicas: 1 + max_num_replicas: 5 + cool_down_period_sec: 60 + cpu_utilization: + utilization_target: 0.5 + target: "{{igrm.selfLink}}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a region instance group manager + google.cloud.gcp_compute_region_instance_group_manager: + name: "{{ resource_name }}" + base_instance_name: test1-child + region: us-central1 + instance_template: "{{ instancetemplate }}" + target_size: 3 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: igrm + ignore_errors: true +- name: delete a instance template + google.cloud.gcp_compute_instance_template: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: instancetemplate + ignore_errors: true +- name: delete a address + google.cloud.gcp_compute_address: + name: address-instancetemplate + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: address + ignore_errors: true +- name: delete a network + google.cloud.gcp_compute_network: + name: network-instancetemplate + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: network + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_autoscaler/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/tasks/autogen.yml new file mode 100644 index 00000000..e6f98329 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/tasks/autogen.yml @@ -0,0 +1,164 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a health check + google.cloud.gcp_compute_health_check: + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port: 80 + check_interval_sec: 1 + timeout_sec: 1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: healthcheck +- name: delete a region backend service + google.cloud.gcp_compute_region_backend_service: + name: "{{ resource_name }}" + region: us-central1 + health_checks: + - "{{ healthcheck.selfLink }}" + connection_draining: + draining_timeout_sec: 10 + session_affinity: CLIENT_IP + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a region backend service + google.cloud.gcp_compute_region_backend_service: + name: "{{ resource_name }}" + region: us-central1 + health_checks: + - "{{ healthcheck.selfLink }}" + connection_draining: + draining_timeout_sec: 10 + session_affinity: CLIENT_IP + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that region_backend_service was created + google.cloud.gcp_compute_region_backend_service_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a region backend service that already exists + google.cloud.gcp_compute_region_backend_service: + name: "{{ resource_name }}" + region: us-central1 + health_checks: + - "{{ healthcheck.selfLink }}" + connection_draining: + draining_timeout_sec: 10 + session_affinity: CLIENT_IP + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a region backend service + google.cloud.gcp_compute_region_backend_service: + name: "{{ resource_name }}" + region: us-central1 + health_checks: + - "{{ healthcheck.selfLink }}" + connection_draining: + draining_timeout_sec: 10 + session_affinity: CLIENT_IP + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that region_backend_service was deleted + google.cloud.gcp_compute_region_backend_service_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a region backend service that does not exist + google.cloud.gcp_compute_region_backend_service: + name: "{{ resource_name }}" + region: us-central1 + health_checks: + - "{{ healthcheck.selfLink }}" + connection_draining: + draining_timeout_sec: 10 + session_affinity: CLIENT_IP + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a health check + google.cloud.gcp_compute_health_check: + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port: 80 + check_interval_sec: 1 + timeout_sec: 1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: healthcheck + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_backend_service/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/tasks/autogen.yml new file mode 100644 index 00000000..ee65f314 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/tasks/autogen.yml @@ -0,0 +1,139 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a region disk + google.cloud.gcp_compute_region_disk: + name: "{{ resource_name }}" + size_gb: 500 + 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 + google.cloud.gcp_compute_region_disk: + name: "{{ resource_name }}" + size_gb: 500 + 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: + that: + - result.changed == true +- name: verify that region_disk was created + google.cloud.gcp_compute_region_disk_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a region disk that already exists + google.cloud.gcp_compute_region_disk: + name: "{{ resource_name }}" + size_gb: 500 + 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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a region disk + google.cloud.gcp_compute_region_disk: + name: "{{ resource_name }}" + size_gb: 500 + 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: + that: + - result.changed == true +- name: verify that region_disk was deleted + google.cloud.gcp_compute_region_disk_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a region disk that does not exist + google.cloud.gcp_compute_region_disk: + name: "{{ resource_name }}" + size_gb: 500 + 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: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_disk/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/tasks/autogen.yml new file mode 100644 index 00000000..1e242cd0 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/tasks/autogen.yml @@ -0,0 +1,149 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a region health check + google.cloud.gcp_compute_region_health_check: + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a region health check + google.cloud.gcp_compute_region_health_check: + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + 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: + that: + - result.changed == true +- name: verify that region_health_check was created + google.cloud.gcp_compute_region_health_check_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a region health check that already exists + google.cloud.gcp_compute_region_health_check: + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + 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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a region health check + google.cloud.gcp_compute_region_health_check: + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + 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: + that: + - result.changed == true +- name: verify that region_health_check was deleted + google.cloud.gcp_compute_region_health_check_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a region health check that does not exist + google.cloud.gcp_compute_region_health_check: + name: "{{ resource_name }}" + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + 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: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_health_check/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/tasks/autogen.yml new file mode 100644 index 00000000..8a78acf1 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/tasks/autogen.yml @@ -0,0 +1,206 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a network + google.cloud.gcp_compute_network: + name: network-instancetemplate + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: network +- name: create a address + google.cloud.gcp_compute_address: + name: address-instancetemplate + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: address +- name: create a instance template + google.cloud.gcp_compute_instance_template: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: instancetemplate +- name: delete a region instance group manager + google.cloud.gcp_compute_region_instance_group_manager: + name: "{{ resource_name }}" + base_instance_name: test1-child + region: us-central1 + instance_template: "{{ instancetemplate }}" + target_size: 3 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a region instance group manager + google.cloud.gcp_compute_region_instance_group_manager: + name: "{{ resource_name }}" + base_instance_name: test1-child + region: us-central1 + instance_template: "{{ instancetemplate }}" + target_size: 3 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that region_instance_group_manager was created + google.cloud.gcp_compute_region_instance_group_manager_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a region instance group manager that already exists + google.cloud.gcp_compute_region_instance_group_manager: + name: "{{ resource_name }}" + base_instance_name: test1-child + region: us-central1 + instance_template: "{{ instancetemplate }}" + target_size: 3 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a region instance group manager + google.cloud.gcp_compute_region_instance_group_manager: + name: "{{ resource_name }}" + base_instance_name: test1-child + region: us-central1 + instance_template: "{{ instancetemplate }}" + target_size: 3 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that region_instance_group_manager was deleted + google.cloud.gcp_compute_region_instance_group_manager_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a region instance group manager that does not exist + google.cloud.gcp_compute_region_instance_group_manager: + name: "{{ resource_name }}" + base_instance_name: test1-child + region: us-central1 + instance_template: "{{ instancetemplate }}" + target_size: 3 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a instance template + google.cloud.gcp_compute_instance_template: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: instancetemplate + ignore_errors: true +- name: delete a address + google.cloud.gcp_compute_address: + name: address-instancetemplate + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: address + ignore_errors: true +- name: delete a network + google.cloud.gcp_compute_network: + name: network-instancetemplate + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: network + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_instance_group_manager/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/tasks/autogen.yml new file mode 100644 index 00000000..ccee592f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/tasks/autogen.yml @@ -0,0 +1,207 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-targethttpproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: instancegroup +- name: create a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: httphealthcheck-targethttpproxy + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: healthcheck +- name: create a backend service + google.cloud.gcp_compute_backend_service: + name: backendservice-targethttpproxy + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: backendservice +- name: create a URL map + google.cloud.gcp_compute_url_map: + name: urlmap-targethttpproxy + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: urlmap +- name: delete a region target HTTP proxy + google.cloud.gcp_compute_region_target_http_proxy: + name: "{{ resource_name }}" + region: us-central1 + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a region target HTTP proxy + google.cloud.gcp_compute_region_target_http_proxy: + name: "{{ resource_name }}" + region: us-central1 + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that region_target_http_proxy was created + google.cloud.gcp_compute_region_target_http_proxy_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a region target HTTP proxy that already exists + google.cloud.gcp_compute_region_target_http_proxy: + name: "{{ resource_name }}" + region: us-central1 + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a region target HTTP proxy + google.cloud.gcp_compute_region_target_http_proxy: + name: "{{ resource_name }}" + region: us-central1 + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that region_target_http_proxy was deleted + google.cloud.gcp_compute_region_target_http_proxy_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a region target HTTP proxy that does not exist + google.cloud.gcp_compute_region_target_http_proxy: + name: "{{ resource_name }}" + region: us-central1 + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a URL map + google.cloud.gcp_compute_url_map: + name: urlmap-targethttpproxy + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: urlmap + ignore_errors: true +- name: delete a backend service + google.cloud.gcp_compute_backend_service: + name: backendservice-targethttpproxy + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: backendservice + ignore_errors: true +- name: delete a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: httphealthcheck-targethttpproxy + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: healthcheck + ignore_errors: true +- name: delete a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-targethttpproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: instancegroup + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_http_proxy/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/tasks/autogen.yml new file mode 100644 index 00000000..1a22974e --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/tasks/autogen.yml @@ -0,0 +1,288 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-targethttpsproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: instancegroup +- name: create a region health check + google.cloud.gcp_compute_region_health_check: + name: "{{ resource_name }}" + type: HTTPS + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: healthcheck +- name: create a region backend service + google.cloud.gcp_compute_region_backend_service: + name: backendservice-targethttpsproxy + region: us-central1 + backends: + - group: "{{ instancegroup.selfLink }}" + healthchecks: + - "{{ healthcheck.selfLink }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: backendservice +- name: create a region URL map + google.cloud.gcp_compute_region_url_map: + name: urlmap-targethttpsproxy + region: us-central1 + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: urlmap +- name: create a SSL certificate + google.cloud.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 + register: sslcert +- name: delete a region target HTTPS proxy + google.cloud.gcp_compute_region_target_https_proxy: + name: "{{ resource_name }}" + region: us-central1 + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a region target HTTPS proxy + google.cloud.gcp_compute_region_target_https_proxy: + name: "{{ resource_name }}" + region: us-central1 + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that region_target_https_proxy was created + google.cloud.gcp_compute_region_target_https_proxy_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a region target HTTPS proxy that already exists + google.cloud.gcp_compute_region_target_https_proxy: + name: "{{ resource_name }}" + region: us-central1 + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a region target HTTPS proxy + google.cloud.gcp_compute_region_target_https_proxy: + name: "{{ resource_name }}" + region: us-central1 + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that region_target_https_proxy was deleted + google.cloud.gcp_compute_region_target_https_proxy_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a region target HTTPS proxy that does not exist + google.cloud.gcp_compute_region_target_https_proxy: + name: "{{ resource_name }}" + region: us-central1 + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a SSL certificate + google.cloud.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 + register: sslcert + ignore_errors: true +- name: delete a region URL map + google.cloud.gcp_compute_region_url_map: + name: urlmap-targethttpsproxy + region: us-central1 + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: urlmap + ignore_errors: true +- name: delete a region backend service + google.cloud.gcp_compute_region_backend_service: + name: backendservice-targethttpsproxy + region: us-central1 + backends: + - group: "{{ instancegroup.selfLink }}" + healthchecks: + - "{{ healthcheck.selfLink }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: backendservice + ignore_errors: true +- name: delete a region health check + google.cloud.gcp_compute_region_health_check: + name: "{{ resource_name }}" + type: HTTPS + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: healthcheck + ignore_errors: true +- name: delete a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-targethttpsproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: instancegroup + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_target_https_proxy/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/tasks/autogen.yml new file mode 100644 index 00000000..1a83e82c --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/tasks/autogen.yml @@ -0,0 +1,169 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a health check + google.cloud.gcp_compute_health_check: + name: "{{ resource_name }}" + type: HTTP + http_health_check: + port: 80 + check_interval_sec: 1 + timeout_sec: 1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: healthcheck +- name: create a region backend service + google.cloud.gcp_compute_region_backend_service: + name: "{{ resource_name }}" + region: us-central1 + health_checks: + - "{{ healthcheck.selfLink }}" + protocol: HTTP + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: backendservice +- name: delete a region URL map + google.cloud.gcp_compute_region_url_map: + name: "{{ resource_name }}" + region: us-central1 + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a region URL map + google.cloud.gcp_compute_region_url_map: + name: "{{ resource_name }}" + region: us-central1 + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that region_url_map was created + google.cloud.gcp_compute_region_url_map_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a region URL map that already exists + google.cloud.gcp_compute_region_url_map: + name: "{{ resource_name }}" + region: us-central1 + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a region URL map + google.cloud.gcp_compute_region_url_map: + name: "{{ resource_name }}" + region: us-central1 + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that region_url_map was deleted + google.cloud.gcp_compute_region_url_map_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a region URL map that does not exist + google.cloud.gcp_compute_region_url_map: + name: "{{ resource_name }}" + region: us-central1 + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a region backend service + google.cloud.gcp_compute_region_backend_service: + name: "{{ resource_name }}" + region: us-central1 + health_checks: + - "{{ healthcheck.selfLink }}" + protocol: HTTP + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: backendservice + ignore_errors: true +- name: delete a health check + google.cloud.gcp_compute_health_check: + name: "{{ resource_name }}" + type: HTTP + http_health_check: + port: 80 + check_interval_sec: 1 + timeout_sec: 1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: healthcheck + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_region_url_map/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/tasks/autogen.yml new file mode 100644 index 00000000..6c637533 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/tasks/autogen.yml @@ -0,0 +1,134 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a reservation + google.cloud.gcp_compute_reservation: + name: "{{ resource_name }}" + zone: us-central1-a + specific_reservation: + count: 1 + instance_properties: + min_cpu_platform: Intel Cascade Lake + machine_type: n2-standard-2 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a reservation + google.cloud.gcp_compute_reservation: + name: "{{ resource_name }}" + zone: us-central1-a + specific_reservation: + count: 1 + instance_properties: + min_cpu_platform: Intel Cascade Lake + machine_type: n2-standard-2 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that reservation was created + google.cloud.gcp_compute_reservation_info: + filters: + - name = {{ resource_name }} + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a reservation that already exists + google.cloud.gcp_compute_reservation: + name: "{{ resource_name }}" + zone: us-central1-a + specific_reservation: + count: 1 + instance_properties: + min_cpu_platform: Intel Cascade Lake + machine_type: n2-standard-2 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a reservation + google.cloud.gcp_compute_reservation: + name: "{{ resource_name }}" + zone: us-central1-a + specific_reservation: + count: 1 + instance_properties: + min_cpu_platform: Intel Cascade Lake + machine_type: n2-standard-2 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that reservation was deleted + google.cloud.gcp_compute_reservation_info: + filters: + - name = {{ resource_name }} + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a reservation that does not exist + google.cloud.gcp_compute_reservation: + name: "{{ resource_name }}" + zone: us-central1-a + specific_reservation: + count: 1 + instance_properties: + min_cpu_platform: Intel Cascade Lake + machine_type: n2-standard-2 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_reservation/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/tasks/autogen.yml new file mode 100644 index 00000000..b7041869 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/tasks/autogen.yml @@ -0,0 +1,134 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a resource policy + google.cloud.gcp_compute_resource_policy: + name: "{{ resource_name }}" + region: us-central1 + snapshot_schedule_policy: + schedule: + daily_schedule: + days_in_cycle: 1 + start_time: '04:00' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a resource policy + google.cloud.gcp_compute_resource_policy: + name: "{{ resource_name }}" + region: us-central1 + snapshot_schedule_policy: + schedule: + daily_schedule: + days_in_cycle: 1 + start_time: '04:00' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that resource_policy was created + google.cloud.gcp_compute_resource_policy_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a resource policy that already exists + google.cloud.gcp_compute_resource_policy: + name: "{{ resource_name }}" + region: us-central1 + snapshot_schedule_policy: + schedule: + daily_schedule: + days_in_cycle: 1 + start_time: '04:00' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a resource policy + google.cloud.gcp_compute_resource_policy: + name: "{{ resource_name }}" + region: us-central1 + snapshot_schedule_policy: + schedule: + daily_schedule: + days_in_cycle: 1 + start_time: '04:00' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that resource_policy was deleted + google.cloud.gcp_compute_resource_policy_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a resource policy that does not exist + google.cloud.gcp_compute_resource_policy: + name: "{{ resource_name }}" + region: us-central1 + snapshot_schedule_policy: + schedule: + daily_schedule: + days_in_cycle: 1 + start_time: '04:00' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_resource_policy/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/tasks/autogen.yml new file mode 100644 index 00000000..28cd1443 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/tasks/autogen.yml @@ -0,0 +1,152 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a network + google.cloud.gcp_compute_network: + name: network-route + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: network +- name: delete a route + google.cloud.gcp_compute_route: + name: "{{ resource_name }}" + dest_range: 192.168.6.0/24 + next_hop_gateway: global/gateways/default-internet-gateway + network: "{{ network }}" + tags: + - backends + - databases + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a route + google.cloud.gcp_compute_route: + name: "{{ resource_name }}" + dest_range: 192.168.6.0/24 + next_hop_gateway: global/gateways/default-internet-gateway + network: "{{ network }}" + tags: + - backends + - databases + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that route was created + google.cloud.gcp_compute_route_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a route that already exists + google.cloud.gcp_compute_route: + name: "{{ resource_name }}" + dest_range: 192.168.6.0/24 + next_hop_gateway: global/gateways/default-internet-gateway + network: "{{ network }}" + tags: + - backends + - databases + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a route + google.cloud.gcp_compute_route: + name: "{{ resource_name }}" + dest_range: 192.168.6.0/24 + next_hop_gateway: global/gateways/default-internet-gateway + network: "{{ network }}" + tags: + - backends + - databases + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that route was deleted + google.cloud.gcp_compute_route_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a route that does not exist + google.cloud.gcp_compute_route: + name: "{{ resource_name }}" + dest_range: 192.168.6.0/24 + next_hop_gateway: global/gateways/default-internet-gateway + network: "{{ network }}" + tags: + - backends + - databases + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a network + google.cloud.gcp_compute_network: + name: network-route + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: network + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_route/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/tasks/autogen.yml new file mode 100644 index 00000000..bfb5b004 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/tasks/autogen.yml @@ -0,0 +1,174 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a network + google.cloud.gcp_compute_network: + name: network-router + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: network +- name: delete a router + google.cloud.gcp_compute_router: + name: "{{ resource_name }}" + 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: create a router + google.cloud.gcp_compute_router: + name: "{{ resource_name }}" + 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: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that router was created + google.cloud.gcp_compute_router_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a router that already exists + google.cloud.gcp_compute_router: + name: "{{ resource_name }}" + 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: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a router + google.cloud.gcp_compute_router: + name: "{{ resource_name }}" + 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: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that router was deleted + google.cloud.gcp_compute_router_info: + filters: + - name = {{ resource_name }} + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a router that does not exist + google.cloud.gcp_compute_router: + name: "{{ resource_name }}" + 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: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a network + google.cloud.gcp_compute_network: + name: network-router + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: network + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_router/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/tasks/autogen.yml new file mode 100644 index 00000000..703c4d30 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/tasks/autogen.yml @@ -0,0 +1,144 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a disk + google.cloud.gcp_compute_disk: + name: disk-snapshot + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: disk +- name: delete a snapshot + google.cloud.gcp_compute_snapshot: + name: "{{ resource_name }}" + source_disk: "{{ disk }}" + zone: us-central1-a + labels: + my_label: value + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a snapshot + google.cloud.gcp_compute_snapshot: + name: "{{ resource_name }}" + source_disk: "{{ disk }}" + zone: us-central1-a + labels: + my_label: value + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that snapshot was created + google.cloud.gcp_compute_snapshot_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a snapshot that already exists + google.cloud.gcp_compute_snapshot: + name: "{{ resource_name }}" + source_disk: "{{ disk }}" + zone: us-central1-a + labels: + my_label: value + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a snapshot + google.cloud.gcp_compute_snapshot: + name: "{{ resource_name }}" + source_disk: "{{ disk }}" + zone: us-central1-a + labels: + my_label: value + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that snapshot was deleted + google.cloud.gcp_compute_snapshot_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a snapshot that does not exist + google.cloud.gcp_compute_snapshot: + name: "{{ resource_name }}" + source_disk: "{{ disk }}" + zone: us-central1-a + labels: + my_label: value + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a disk + google.cloud.gcp_compute_disk: + name: disk-snapshot + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: disk + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_snapshot/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/tasks/autogen.yml new file mode 100644 index 00000000..0c699799 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/tasks/autogen.yml @@ -0,0 +1,232 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a SSL certificate + google.cloud.gcp_compute_ssl_certificate: + name: "{{ resource_name }}" + region: us-central1 + 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 + google.cloud.gcp_compute_ssl_certificate: + name: "{{ resource_name }}" + region: us-central1 + 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: + that: + - result.changed == true +- name: verify that ssl_certificate was created + google.cloud.gcp_compute_ssl_certificate_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a SSL certificate that already exists + google.cloud.gcp_compute_ssl_certificate: + name: "{{ resource_name }}" + region: us-central1 + 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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a SSL certificate + google.cloud.gcp_compute_ssl_certificate: + name: "{{ resource_name }}" + region: us-central1 + 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: + that: + - result.changed == true +- name: verify that ssl_certificate was deleted + google.cloud.gcp_compute_ssl_certificate_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a SSL certificate that does not exist + google.cloud.gcp_compute_ssl_certificate: + name: "{{ resource_name }}" + region: us-central1 + 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: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_certificate/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/tasks/autogen.yml new file mode 100644 index 00000000..70380ddc --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/tasks/autogen.yml @@ -0,0 +1,127 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a SSL policy + google.cloud.gcp_compute_ssl_policy: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a SSL policy + google.cloud.gcp_compute_ssl_policy: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that ssl_policy was created + google.cloud.gcp_compute_ssl_policy_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a SSL policy that already exists + google.cloud.gcp_compute_ssl_policy: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a SSL policy + google.cloud.gcp_compute_ssl_policy: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that ssl_policy was deleted + google.cloud.gcp_compute_ssl_policy_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a SSL policy that does not exist + google.cloud.gcp_compute_ssl_policy: + name: "{{ resource_name }}" + 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: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_ssl_policy/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/tasks/autogen.yml new file mode 100644 index 00000000..7a3a2f43 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/tasks/autogen.yml @@ -0,0 +1,141 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a network + google.cloud.gcp_compute_network: + name: network-subnetwork + auto_create_subnetworks: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: network +- name: delete a subnetwork + google.cloud.gcp_compute_subnetwork: + name: ansiblenet + region: us-west1 + network: "{{ network }}" + ip_cidr_range: 172.16.0.0/16 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a subnetwork + google.cloud.gcp_compute_subnetwork: + name: ansiblenet + region: us-west1 + network: "{{ network }}" + ip_cidr_range: 172.16.0.0/16 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that subnetwork was created + google.cloud.gcp_compute_subnetwork_info: + filters: + - name = ansiblenet + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a subnetwork that already exists + google.cloud.gcp_compute_subnetwork: + name: ansiblenet + region: us-west1 + network: "{{ network }}" + ip_cidr_range: 172.16.0.0/16 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a subnetwork + google.cloud.gcp_compute_subnetwork: + name: ansiblenet + region: us-west1 + network: "{{ network }}" + ip_cidr_range: 172.16.0.0/16 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that subnetwork was deleted + google.cloud.gcp_compute_subnetwork_info: + filters: + - name = ansiblenet + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a subnetwork that does not exist + google.cloud.gcp_compute_subnetwork: + name: ansiblenet + region: us-west1 + network: "{{ network }}" + ip_cidr_range: 172.16.0.0/16 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a network + google.cloud.gcp_compute_network: + name: network-subnetwork + auto_create_subnetworks: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: network + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_subnetwork/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/tasks/autogen.yml new file mode 100644 index 00000000..99358c4f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/tasks/autogen.yml @@ -0,0 +1,200 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-targethttpproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: instancegroup +- name: create a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: httphealthcheck-targethttpproxy + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: healthcheck +- name: create a backend service + google.cloud.gcp_compute_backend_service: + name: backendservice-targethttpproxy + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: backendservice +- name: create a URL map + google.cloud.gcp_compute_url_map: + name: urlmap-targethttpproxy + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: urlmap +- name: delete a target HTTP proxy + google.cloud.gcp_compute_target_http_proxy: + name: "{{ resource_name }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a target HTTP proxy + google.cloud.gcp_compute_target_http_proxy: + name: "{{ resource_name }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that target_http_proxy was created + google.cloud.gcp_compute_target_http_proxy_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a target HTTP proxy that already exists + google.cloud.gcp_compute_target_http_proxy: + name: "{{ resource_name }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a target HTTP proxy + google.cloud.gcp_compute_target_http_proxy: + name: "{{ resource_name }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that target_http_proxy was deleted + google.cloud.gcp_compute_target_http_proxy_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a target HTTP proxy that does not exist + google.cloud.gcp_compute_target_http_proxy: + name: "{{ resource_name }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a URL map + google.cloud.gcp_compute_url_map: + name: urlmap-targethttpproxy + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: urlmap + ignore_errors: true +- name: delete a backend service + google.cloud.gcp_compute_backend_service: + name: backendservice-targethttpproxy + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: backendservice + ignore_errors: true +- name: delete a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: httphealthcheck-targethttpproxy + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: healthcheck + ignore_errors: true +- name: delete a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-targethttpproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: instancegroup + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_http_proxy/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/tasks/autogen.yml new file mode 100644 index 00000000..1985bcd6 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/tasks/autogen.yml @@ -0,0 +1,277 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-targethttpsproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: instancegroup +- name: create a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: httphealthcheck-targethttpsproxy + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: healthcheck +- name: create a backend service + google.cloud.gcp_compute_backend_service: + name: backendservice-targethttpsproxy + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: backendservice +- name: create a URL map + google.cloud.gcp_compute_url_map: + name: urlmap-targethttpsproxy + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: urlmap +- name: create a SSL certificate + google.cloud.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 + register: sslcert +- name: delete a target HTTPS proxy + google.cloud.gcp_compute_target_https_proxy: + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a target HTTPS proxy + google.cloud.gcp_compute_target_https_proxy: + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that target_https_proxy was created + google.cloud.gcp_compute_target_https_proxy_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a target HTTPS proxy that already exists + google.cloud.gcp_compute_target_https_proxy: + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a target HTTPS proxy + google.cloud.gcp_compute_target_https_proxy: + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that target_https_proxy was deleted + google.cloud.gcp_compute_target_https_proxy_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a target HTTPS proxy that does not exist + google.cloud.gcp_compute_target_https_proxy: + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + url_map: "{{ urlmap }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a SSL certificate + google.cloud.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 + register: sslcert + ignore_errors: true +- name: delete a URL map + google.cloud.gcp_compute_url_map: + name: urlmap-targethttpsproxy + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: urlmap + ignore_errors: true +- name: delete a backend service + google.cloud.gcp_compute_backend_service: + name: backendservice-targethttpsproxy + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: backendservice + ignore_errors: true +- name: delete a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: httphealthcheck-targethttpsproxy + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: healthcheck + ignore_errors: true +- name: delete a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-targethttpsproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: instancegroup + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_https_proxy/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/tasks/autogen.yml new file mode 100644 index 00000000..7bedbcea --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/tasks/autogen.yml @@ -0,0 +1,173 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a network + google.cloud.gcp_compute_network: + 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 + google.cloud.gcp_compute_instance: + name: "{{ resource_name }}" + machine_type: n1-standard-1 + disks: + - auto_delete: 'true' + boot: 'true' + initialize_params: + source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts + labels: + environment: production + network_interfaces: + - network: "{{ network }}" + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: instance +- name: delete a target instance + google.cloud.gcp_compute_target_instance: + name: target + instance: "{{ instance }}" + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a target instance + google.cloud.gcp_compute_target_instance: + name: target + instance: "{{ instance }}" + zone: 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: + that: + - result.changed == true +- name: verify that target_instance was created + google.cloud.gcp_compute_target_instance_info: + filters: + - name = target + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a target instance that already exists + google.cloud.gcp_compute_target_instance: + name: target + instance: "{{ instance }}" + zone: 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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a target instance + google.cloud.gcp_compute_target_instance: + name: target + instance: "{{ instance }}" + zone: 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: + that: + - result.changed == true +- name: verify that target_instance was deleted + google.cloud.gcp_compute_target_instance_info: + filters: + - name = target + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a target instance that does not exist + google.cloud.gcp_compute_target_instance: + name: target + instance: "{{ instance }}" + zone: 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: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a instance + google.cloud.gcp_compute_instance: + name: "{{ resource_name }}" + machine_type: n1-standard-1 + disks: + - auto_delete: 'true' + boot: 'true' + initialize_params: + source_image: projects/ubuntu-os-cloud/global/images/family/ubuntu-1604-lts + labels: + environment: production + network_interfaces: + - network: "{{ network }}" + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: instance + ignore_errors: true +- name: delete a network + google.cloud.gcp_compute_network: + 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/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_instance/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/tasks/autogen.yml new file mode 100644 index 00000000..9bad8a9f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/tasks/autogen.yml @@ -0,0 +1,109 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a target pool + google.cloud.gcp_compute_target_pool: + name: "{{ resource_name }}" + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a target pool + google.cloud.gcp_compute_target_pool: + name: "{{ resource_name }}" + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that target_pool was created + google.cloud.gcp_compute_target_pool_info: + filters: + - name = {{ resource_name }} + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a target pool that already exists + google.cloud.gcp_compute_target_pool: + name: "{{ resource_name }}" + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a target pool + google.cloud.gcp_compute_target_pool: + name: "{{ resource_name }}" + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that target_pool was deleted + google.cloud.gcp_compute_target_pool_info: + filters: + - name = {{ resource_name }} + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a target pool that does not exist + google.cloud.gcp_compute_target_pool: + name: "{{ resource_name }}" + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_pool/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/tasks/autogen.yml new file mode 100644 index 00000000..0c852df0 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/tasks/autogen.yml @@ -0,0 +1,266 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-targetsslproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: instancegroup +- name: create a health check + google.cloud.gcp_compute_health_check: + name: healthcheck-targetsslproxy + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: healthcheck +- name: create a backend service + google.cloud.gcp_compute_backend_service: + name: backendservice-targetsslproxy + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + protocol: SSL + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: backendservice +- name: create a SSL certificate + google.cloud.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 + register: sslcert +- name: delete a target SSL proxy + google.cloud.gcp_compute_target_ssl_proxy: + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a target SSL proxy + google.cloud.gcp_compute_target_ssl_proxy: + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that target_ssl_proxy was created + google.cloud.gcp_compute_target_ssl_proxy_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a target SSL proxy that already exists + google.cloud.gcp_compute_target_ssl_proxy: + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a target SSL proxy + google.cloud.gcp_compute_target_ssl_proxy: + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that target_ssl_proxy was deleted + google.cloud.gcp_compute_target_ssl_proxy_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a target SSL proxy that does not exist + google.cloud.gcp_compute_target_ssl_proxy: + name: "{{ resource_name }}" + ssl_certificates: + - "{{ sslcert }}" + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a SSL certificate + google.cloud.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 + register: sslcert + ignore_errors: true +- name: delete a backend service + google.cloud.gcp_compute_backend_service: + name: backendservice-targetsslproxy + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + protocol: SSL + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: backendservice + ignore_errors: true +- name: delete a health check + google.cloud.gcp_compute_health_check: + name: healthcheck-targetsslproxy + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: healthcheck + ignore_errors: true +- name: delete a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-targetsslproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: instancegroup + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_ssl_proxy/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/tasks/autogen.yml new file mode 100644 index 00000000..c2d6a86e --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/tasks/autogen.yml @@ -0,0 +1,194 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-targettcpproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: instancegroup +- name: create a health check + google.cloud.gcp_compute_health_check: + name: healthcheck-targettcpproxy + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: healthcheck +- name: create a backend service + google.cloud.gcp_compute_backend_service: + name: backendservice-targettcpproxy + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + protocol: TCP + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: backendservice +- name: delete a target TCP proxy + google.cloud.gcp_compute_target_tcp_proxy: + name: "{{ resource_name }}" + proxy_header: PROXY_V1 + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a target TCP proxy + google.cloud.gcp_compute_target_tcp_proxy: + name: "{{ resource_name }}" + proxy_header: PROXY_V1 + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that target_tcp_proxy was created + google.cloud.gcp_compute_target_tcp_proxy_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a target TCP proxy that already exists + google.cloud.gcp_compute_target_tcp_proxy: + name: "{{ resource_name }}" + proxy_header: PROXY_V1 + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a target TCP proxy + google.cloud.gcp_compute_target_tcp_proxy: + name: "{{ resource_name }}" + proxy_header: PROXY_V1 + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that target_tcp_proxy was deleted + google.cloud.gcp_compute_target_tcp_proxy_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a target TCP proxy that does not exist + google.cloud.gcp_compute_target_tcp_proxy: + name: "{{ resource_name }}" + proxy_header: PROXY_V1 + service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a backend service + google.cloud.gcp_compute_backend_service: + name: backendservice-targettcpproxy + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + protocol: TCP + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: backendservice + ignore_errors: true +- name: delete a health check + google.cloud.gcp_compute_health_check: + name: healthcheck-targettcpproxy + type: TCP + tcp_health_check: + port_name: service-health + request: ping + response: pong + healthy_threshold: 10 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: healthcheck + ignore_errors: true +- name: delete a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-targettcpproxy + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: instancegroup + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_tcp_proxy/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/tasks/autogen.yml new file mode 100644 index 00000000..5e39f6d8 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/tasks/autogen.yml @@ -0,0 +1,153 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a address + google.cloud.gcp_compute_address: + name: address-vpngateway + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: address +- name: create a network + google.cloud.gcp_compute_network: + name: network-vpngateway + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: network +- name: delete a target vpn gateway + google.cloud.gcp_compute_target_vpn_gateway: + name: "{{ resource_name }}" + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a target vpn gateway + google.cloud.gcp_compute_target_vpn_gateway: + name: "{{ resource_name }}" + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that target_vpn_gateway was created + google.cloud.gcp_compute_target_vpn_gateway_info: + filters: + - name = {{ resource_name }} + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a target vpn gateway that already exists + google.cloud.gcp_compute_target_vpn_gateway: + name: "{{ resource_name }}" + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a target vpn gateway + google.cloud.gcp_compute_target_vpn_gateway: + name: "{{ resource_name }}" + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that target_vpn_gateway was deleted + google.cloud.gcp_compute_target_vpn_gateway_info: + filters: + - name = {{ resource_name }} + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a target vpn gateway that does not exist + google.cloud.gcp_compute_target_vpn_gateway: + name: "{{ resource_name }}" + region: us-west1 + network: "{{ network }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a network + google.cloud.gcp_compute_network: + name: network-vpngateway + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: network + ignore_errors: true +- name: delete a address + google.cloud.gcp_compute_address: + name: address-vpngateway + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: address + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_target_vpn_gateway/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/tasks/autogen.yml new file mode 100644 index 00000000..f39671c3 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/tasks/autogen.yml @@ -0,0 +1,181 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-urlmap + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: instancegroup +- name: create a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: httphealthcheck-urlmap + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: healthcheck +- name: create a backend service + google.cloud.gcp_compute_backend_service: + name: backendservice-urlmap + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: backendservice +- name: delete a URL map + google.cloud.gcp_compute_url_map: + name: "{{ resource_name }}" + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a URL map + google.cloud.gcp_compute_url_map: + name: "{{ resource_name }}" + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that url_map was created + google.cloud.gcp_compute_url_map_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a URL map that already exists + google.cloud.gcp_compute_url_map: + name: "{{ resource_name }}" + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a URL map + google.cloud.gcp_compute_url_map: + name: "{{ resource_name }}" + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that url_map was deleted + google.cloud.gcp_compute_url_map_info: + filters: + - name = {{ resource_name }} + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a URL map that does not exist + google.cloud.gcp_compute_url_map: + name: "{{ resource_name }}" + default_service: "{{ backendservice }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a backend service + google.cloud.gcp_compute_backend_service: + name: backendservice-urlmap + backends: + - group: "{{ instancegroup.selfLink }}" + health_checks: + - "{{ healthcheck.selfLink }}" + enable_cdn: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: backendservice + ignore_errors: true +- name: delete a HTTP health check + google.cloud.gcp_compute_http_health_check: + name: httphealthcheck-urlmap + healthy_threshold: 10 + port: 8080 + timeout_sec: 2 + unhealthy_threshold: 5 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: healthcheck + ignore_errors: true +- name: delete a instance group + google.cloud.gcp_compute_instance_group: + name: instancegroup-urlmap + zone: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: instancegroup + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_url_map/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/tasks/autogen.yml new file mode 100644 index 00000000..b28b7a27 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/tasks/autogen.yml @@ -0,0 +1,202 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a network + google.cloud.gcp_compute_network: + 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 + google.cloud.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 + register: router +- name: create a target vpn gateway + google.cloud.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 + register: gateway +- name: delete a vpn tunnel + google.cloud.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: create a vpn tunnel + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that vpn_tunnel was created + google.cloud.gcp_compute_vpn_tunnel_info: + filters: + - name = {{ resource_name }} + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a vpn tunnel that already exists + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a vpn tunnel + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that vpn_tunnel was deleted + google.cloud.gcp_compute_vpn_tunnel_info: + filters: + - name = {{ resource_name }} + region: us-west1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/compute + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a vpn tunnel that does not exist + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a target vpn gateway + google.cloud.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 + register: gateway + ignore_errors: true +- name: delete a router + google.cloud.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 + register: router + ignore_errors: true +- name: delete a network + google.cloud.gcp_compute_network: + 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/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_compute_vpn_tunnel/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/tasks/autogen.yml new file mode 100644 index 00000000..b0c69a39 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/tasks/autogen.yml @@ -0,0 +1,140 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a cluster + google.cloud.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: create a cluster + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that cluster was created + google.cloud.gcp_container_cluster_info: + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - "'my-cluster' in \"{{ results['resources'] | map(attribute='name') | list }}\"" +# ---------------------------------------------------------------------------- +- name: create a cluster that already exists + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a cluster + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that cluster was deleted + google.cloud.gcp_container_cluster_info: + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - "'my-cluster' not in \"{{ results['resources'] | map(attribute='name') | list }}\"" +# ---------------------------------------------------------------------------- +- name: delete a cluster that does not exist + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_cluster/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/tasks/autogen.yml new file mode 100644 index 00000000..85cc4287 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/tasks/autogen.yml @@ -0,0 +1,141 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a cluster + google.cloud.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 + register: cluster +- name: delete a node pool + google.cloud.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: create a node pool + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that node_pool was created + google.cloud.gcp_container_node_pool_info: + cluster: "{{ cluster }}" + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - "'my-pool' in \"{{ results['resources'] | map(attribute='name') | list }}\"" +# ---------------------------------------------------------------------------- +- name: create a node pool that already exists + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a node pool + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that node_pool was deleted + google.cloud.gcp_container_node_pool_info: + cluster: "{{ cluster }}" + location: us-central1-a + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - "'my-pool' not in \"{{ results['resources'] | map(attribute='name') | list }}\"" +# ---------------------------------------------------------------------------- +- name: delete a node pool that does not exist + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a cluster + google.cloud.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 + register: cluster + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_container_node_pool/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/tasks/autogen.yml new file mode 100644 index 00000000..6373750e --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/tasks/autogen.yml @@ -0,0 +1,110 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a managed zone + google.cloud.gcp_dns_managed_zone: + name: "{{ resource_name }}" + dns_name: test.somewild2.example.com. + description: test zone + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a managed zone + google.cloud.gcp_dns_managed_zone: + name: "{{ resource_name }}" + dns_name: test.somewild2.example.com. + description: test zone + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that managed_zone was created + google.cloud.gcp_dns_managed_zone_info: + dns_name: test.somewild2.example.com. + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/ndev.clouddns.readwrite + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +# ---------------------------------------------------------------------------- +- name: create a managed zone that already exists + google.cloud.gcp_dns_managed_zone: + name: "{{ resource_name }}" + dns_name: test.somewild2.example.com. + description: test zone + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a managed zone + google.cloud.gcp_dns_managed_zone: + name: "{{ resource_name }}" + dns_name: test.somewild2.example.com. + description: test zone + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that managed_zone was deleted + google.cloud.gcp_dns_managed_zone_info: + dns_name: test.somewild2.example.com. + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/ndev.clouddns.readwrite + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a managed zone that does not exist + google.cloud.gcp_dns_managed_zone: + name: "{{ resource_name }}" + dns_name: test.somewild2.example.com. + description: test zone + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_managed_zone/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/tasks/autogen.yml new file mode 100644 index 00000000..f190966c --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/tasks/autogen.yml @@ -0,0 +1,154 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a managed zone + google.cloud.gcp_dns_managed_zone: + name: managedzone-rrs + dns_name: testzone-4.com. + description: test zone + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: managed_zone +- name: delete a resource record set + google.cloud.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: create a resource record set + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that resource_record_set was created + google.cloud.gcp_dns_resource_record_set_info: + managed_zone: "{{ managed_zone }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/ndev.clouddns.readwrite + register: results +- name: verify that command succeeded + assert: + that: + - "'www.testzone-4.com.'in \"{{ results['resources'] | map(attribute='name') | list }}\"" +# ---------------------------------------------------------------------------- +- name: create a resource record set that already exists + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a resource record set + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that resource_record_set was deleted + google.cloud.gcp_dns_resource_record_set_info: + managed_zone: "{{ managed_zone }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/ndev.clouddns.readwrite + register: results +- name: verify that command succeeded + assert: + that: + - "'www.testzone-4.com.'not in \"{{ results['resources'] | map(attribute='name') | list }}\"" +# ---------------------------------------------------------------------------- +- name: delete a resource record set that does not exist + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a managed zone + google.cloud.gcp_dns_managed_zone: + name: managedzone-rrs + dns_name: testzone-4.com. + description: test zone + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: managed_zone + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_dns_resource_record_set/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/tasks/autogen.yml new file mode 100644 index 00000000..c9f1d170 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/tasks/autogen.yml @@ -0,0 +1,145 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a instance + google.cloud.gcp_filestore_instance: + name: "{{ resource_name }}" + zone: us-central1-b + tier: PREMIUM + file_shares: + - capacity_gb: 2660 + name: share1 + networks: + - network: default + modes: + - MODE_IPV4 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a instance + google.cloud.gcp_filestore_instance: + name: "{{ resource_name }}" + zone: us-central1-b + tier: PREMIUM + file_shares: + - capacity_gb: 2660 + name: share1 + networks: + - network: default + modes: + - MODE_IPV4 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that instance was created + google.cloud.gcp_filestore_instance_info: + zone: us-central1-b + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a instance that already exists + google.cloud.gcp_filestore_instance: + name: "{{ resource_name }}" + zone: us-central1-b + tier: PREMIUM + file_shares: + - capacity_gb: 2660 + name: share1 + networks: + - network: default + modes: + - MODE_IPV4 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a instance + google.cloud.gcp_filestore_instance: + name: "{{ resource_name }}" + zone: us-central1-b + tier: PREMIUM + file_shares: + - capacity_gb: 2660 + name: share1 + networks: + - network: default + modes: + - MODE_IPV4 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that instance was deleted + google.cloud.gcp_filestore_instance_info: + zone: us-central1-b + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a instance that does not exist + google.cloud.gcp_filestore_instance: + name: "{{ resource_name }}" + zone: us-central1-b + tier: PREMIUM + file_shares: + - capacity_gb: 2660 + name: share1 + networks: + - network: default + modes: + - MODE_IPV4 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_filestore_instance/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/tasks/autogen.yml new file mode 100644 index 00000000..7d28873f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/tasks/autogen.yml @@ -0,0 +1,128 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a role + google.cloud.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: create a role + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that role was created + google.cloud.gcp_iam_role_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/iam + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*myCustomRole2.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a role that already exists + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a role + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that role was deleted + google.cloud.gcp_iam_role_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/iam + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*myCustomRole2.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a role that does not exist + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_role/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/tasks/autogen.yml new file mode 100644 index 00000000..1d9f9511 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/tasks/autogen.yml @@ -0,0 +1,103 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a service account + google.cloud.gcp_iam_service_account: + name: sa-{{ resource_name.split("-")[-1] }}@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: absent +#---------------------------------------------------------- +- name: create a service account + google.cloud.gcp_iam_service_account: + name: sa-{{ resource_name.split("-")[-1] }}@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: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that service_account was created + google.cloud.gcp_iam_service_account_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/iam + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*sa-{{ resource_name.split("-")[-1] }}@graphite-playground.google.com.iam.gserviceaccount.com.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a service account that already exists + google.cloud.gcp_iam_service_account: + name: sa-{{ resource_name.split("-")[-1] }}@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: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a service account + google.cloud.gcp_iam_service_account: + name: sa-{{ resource_name.split("-")[-1] }}@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: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that service_account was deleted + google.cloud.gcp_iam_service_account_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/iam + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*sa-{{ resource_name.split("-")[-1] }}@graphite-playground.google.com.iam.gserviceaccount.com.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a service account that does not exist + google.cloud.gcp_iam_service_account: + name: sa-{{ resource_name.split("-")[-1] }}@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: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account_key/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account_key/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account_key/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account_key/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account_key/defaults/main.yml new file mode 100644 index 00000000..aa87a2a8 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account_key/defaults/main.yml @@ -0,0 +1,3 @@ +--- +# defaults file +resource_name: '{{resource_prefix}}' diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account_key/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account_key/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_iam_service_account_key/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/tasks/autogen.yml new file mode 100644 index 00000000..ef2252c8 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/tasks/autogen.yml @@ -0,0 +1,73 @@ +# Copyright 2019 Google Inc. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +--- +# Pre-test setup +- name: create a key ring + gcp_kms_key_ring: + name: key-key-ring + location: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: keyring +- name: delete a crypto key + gcp_kms_crypto_key: + name: "{{ resource_name }}" + key_ring: projects/{{ gcp_project }}/locations/us-central1/keyRings/key-key-ring + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a crypto key + gcp_kms_crypto_key: + name: "{{ resource_name }}" + key_ring: projects/{{ gcp_project }}/locations/us-central1/keyRings/key-key-ring + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that crypto_key was created + gcp_kms_crypto_key_info: + key_ring: "projects/{{ gcp_project }}/locations/us-central1/keyRings/key-key-ring" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloudkms + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a crypto key that already exists + gcp_kms_crypto_key: + name: "{{ resource_name }}" + key_ring: projects/{{ gcp_project }}/locations/us-central1/keyRings/key-key-ring + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_crypto_key/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/tasks/autogen.yml new file mode 100644 index 00000000..34999ab1 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/tasks/autogen.yml @@ -0,0 +1,63 @@ +# Copyright 2019 Google Inc. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Pre-test setup +- name: delete a key ring + gcp_kms_key_ring: + name: "{{ resource_name }}" + location: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a key ring + gcp_kms_key_ring: + name: "{{ resource_name }}" + location: 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: + that: + - result.changed == true +- name: verify that key_ring was created + gcp_kms_key_ring_info: + location: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloudkms + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a key ring that already exists + gcp_kms_key_ring: + name: "{{ resource_name }}" + location: 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: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_kms_key_ring/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/tasks/autogen.yml new file mode 100644 index 00000000..914d51bc --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/tasks/autogen.yml @@ -0,0 +1,183 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a metric + google.cloud.gcp_logging_metric: + name: "{{ resource_name }}" + filter: resource.type=gae_app AND severity>=ERROR + metric_descriptor: + metric_kind: DELTA + value_type: DISTRIBUTION + unit: '1' + labels: + - key: mass + value_type: STRING + description: amount of matter + value_extractor: EXTRACT(jsonPayload.request) + label_extractors: + mass: EXTRACT(jsonPayload.request) + bucket_options: + linear_buckets: + num_finite_buckets: 3 + width: 1 + offset: 1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a metric + google.cloud.gcp_logging_metric: + name: "{{ resource_name }}" + filter: resource.type=gae_app AND severity>=ERROR + metric_descriptor: + metric_kind: DELTA + value_type: DISTRIBUTION + unit: '1' + labels: + - key: mass + value_type: STRING + description: amount of matter + value_extractor: EXTRACT(jsonPayload.request) + label_extractors: + mass: EXTRACT(jsonPayload.request) + bucket_options: + linear_buckets: + num_finite_buckets: 3 + width: 1 + offset: 1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that metric was created + google.cloud.gcp_logging_metric_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a metric that already exists + google.cloud.gcp_logging_metric: + name: "{{ resource_name }}" + filter: resource.type=gae_app AND severity>=ERROR + metric_descriptor: + metric_kind: DELTA + value_type: DISTRIBUTION + unit: '1' + labels: + - key: mass + value_type: STRING + description: amount of matter + value_extractor: EXTRACT(jsonPayload.request) + label_extractors: + mass: EXTRACT(jsonPayload.request) + bucket_options: + linear_buckets: + num_finite_buckets: 3 + width: 1 + offset: 1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a metric + google.cloud.gcp_logging_metric: + name: "{{ resource_name }}" + filter: resource.type=gae_app AND severity>=ERROR + metric_descriptor: + metric_kind: DELTA + value_type: DISTRIBUTION + unit: '1' + labels: + - key: mass + value_type: STRING + description: amount of matter + value_extractor: EXTRACT(jsonPayload.request) + label_extractors: + mass: EXTRACT(jsonPayload.request) + bucket_options: + linear_buckets: + num_finite_buckets: 3 + width: 1 + offset: 1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that metric was deleted + google.cloud.gcp_logging_metric_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a metric that does not exist + google.cloud.gcp_logging_metric: + name: "{{ resource_name }}" + filter: resource.type=gae_app AND severity>=ERROR + metric_descriptor: + metric_kind: DELTA + value_type: DISTRIBUTION + unit: '1' + labels: + - key: mass + value_type: STRING + description: amount of matter + value_extractor: EXTRACT(jsonPayload.request) + label_extractors: + mass: EXTRACT(jsonPayload.request) + bucket_options: + linear_buckets: + num_finite_buckets: 3 + width: 1 + offset: 1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_logging_metric/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/tasks/autogen.yml new file mode 100644 index 00000000..2defa6c2 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/tasks/autogen.yml @@ -0,0 +1,113 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a model + google.cloud.gcp_mlengine_model: + name: "{{ resource_name | replace('-', '_') }}" + description: My model + regions: + - us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a model + google.cloud.gcp_mlengine_model: + name: "{{ resource_name | replace('-', '_') }}" + description: My model + regions: + - 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: + that: + - result.changed == true +- name: verify that model was created + google.cloud.gcp_mlengine_model_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name | replace('-', '_') }}.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a model that already exists + google.cloud.gcp_mlengine_model: + name: "{{ resource_name | replace('-', '_') }}" + description: My model + regions: + - 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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a model + google.cloud.gcp_mlengine_model: + name: "{{ resource_name | replace('-', '_') }}" + description: My model + regions: + - 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: + that: + - result.changed == true +- name: verify that model was deleted + google.cloud.gcp_mlengine_model_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name | replace('-', '_') }}.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a model that does not exist + google.cloud.gcp_mlengine_model: + name: "{{ resource_name | replace('-', '_') }}" + description: My model + regions: + - 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: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_model/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/tasks/autogen.yml new file mode 100644 index 00000000..ad4def7d --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/tasks/autogen.yml @@ -0,0 +1,155 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a model + google.cloud.gcp_mlengine_model: + name: model_version + description: My model + regions: + - us-central1 + online_prediction_logging: 'true' + online_prediction_console_logging: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: model +- name: delete a version + google.cloud.gcp_mlengine_version: + name: "{{ resource_name | replace('-', '_') }}" + model: "{{ model }}" + runtime_version: 1.13 + python_version: 3.5 + is_default: 'true' + deployment_uri: gs://ansible-cloudml-bucket/ + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a version + google.cloud.gcp_mlengine_version: + name: "{{ resource_name | replace('-', '_') }}" + model: "{{ model }}" + runtime_version: 1.13 + python_version: 3.5 + is_default: 'true' + deployment_uri: gs://ansible-cloudml-bucket/ + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that version was created + google.cloud.gcp_mlengine_version_info: + model: "{{ model }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name | replace('-', '_') }}.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a version that already exists + google.cloud.gcp_mlengine_version: + name: "{{ resource_name | replace('-', '_') }}" + model: "{{ model }}" + runtime_version: 1.13 + python_version: 3.5 + is_default: 'true' + deployment_uri: gs://ansible-cloudml-bucket/ + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a version + google.cloud.gcp_mlengine_version: + name: "{{ resource_name | replace('-', '_') }}" + model: "{{ model }}" + runtime_version: 1.13 + python_version: 3.5 + is_default: 'true' + deployment_uri: gs://ansible-cloudml-bucket/ + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that version was deleted + google.cloud.gcp_mlengine_version_info: + model: "{{ model }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name | replace('-', '_') }}.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a version that does not exist + google.cloud.gcp_mlengine_version: + name: "{{ resource_name | replace('-', '_') }}" + model: "{{ model }}" + runtime_version: 1.13 + python_version: 3.5 + is_default: 'true' + deployment_uri: gs://ansible-cloudml-bucket/ + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a model + google.cloud.gcp_mlengine_model: + name: model_version + description: My model + regions: + - us-central1 + online_prediction_logging: 'true' + online_prediction_console_logging: 'true' + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: model + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_mlengine_version/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/tasks/autogen.yml new file mode 100644 index 00000000..da8fde6e --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/tasks/autogen.yml @@ -0,0 +1,128 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a topic + google.cloud.gcp_pubsub_topic: + name: topic-subscription + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: topic +- name: delete a subscription + google.cloud.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: create a subscription + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that subscription was created + google.cloud.gcp_pubsub_subscription_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/pubsub + register: results +- name: verify that command succeeded + assert: + that: + - "\"{{resource_name}}\" in \"{{ results['resources'] | map(attribute='name') | list }}\"" +# ---------------------------------------------------------------------------- +- name: create a subscription that already exists + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a subscription + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that subscription was deleted + google.cloud.gcp_pubsub_subscription_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/pubsub + register: results +- name: verify that command succeeded + assert: + that: + - "\"{{resource_name}}\" not in \"{{ results['resources'] | map(attribute='name') | list }}\"" +# ---------------------------------------------------------------------------- +- name: delete a subscription that does not exist + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a topic + google.cloud.gcp_pubsub_topic: + name: topic-subscription + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: topic + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_subscription/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/tasks/autogen.yml new file mode 100644 index 00000000..94634828 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/tasks/autogen.yml @@ -0,0 +1,98 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a topic + google.cloud.gcp_pubsub_topic: + name: test-topic1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a topic + google.cloud.gcp_pubsub_topic: + name: test-topic1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that topic was created + google.cloud.gcp_pubsub_topic_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/pubsub + register: results +- name: verify that command succeeded + assert: + that: + - "'test-topic1' in \"{{ results['resources'] | map(attribute='name') | list }}\"" +# ---------------------------------------------------------------------------- +- name: create a topic that already exists + google.cloud.gcp_pubsub_topic: + name: test-topic1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a topic + google.cloud.gcp_pubsub_topic: + name: test-topic1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that topic was deleted + google.cloud.gcp_pubsub_topic_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/pubsub + register: results +- name: verify that command succeeded + assert: + that: + - "'test-topic1' not in \"{{ results['resources'] | map(attribute='name') | list }}\"" +# ---------------------------------------------------------------------------- +- name: delete a topic that does not exist + google.cloud.gcp_pubsub_topic: + name: test-topic1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_pubsub_topic/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/tasks/autogen.yml new file mode 100644 index 00000000..af88e0b4 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/tasks/autogen.yml @@ -0,0 +1,170 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a network + google.cloud.gcp_compute_network: + 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 + google.cloud.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: create a instance + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that instance was created + google.cloud.gcp_redis_instance_info: + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*instance37.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a instance that already exists + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a instance + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that instance was deleted + google.cloud.gcp_redis_instance_info: + region: us-central1 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*instance37.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a instance that does not exist + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a network + google.cloud.gcp_compute_network: + 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/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_redis_instance/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/tasks/autogen.yml new file mode 100644 index 00000000..ea1e45c6 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/tasks/autogen.yml @@ -0,0 +1,113 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a project + google.cloud.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: create a project + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that project was created + google.cloud.gcp_resourcemanager_project_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*My Sample Project.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a project that already exists + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a project + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that project was deleted + google.cloud.gcp_resourcemanager_project_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*My Sample Project.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a project that does not exist + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_resourcemanager_project/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/tasks/autogen.yml new file mode 100644 index 00000000..487ddfdb --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/tasks/autogen.yml @@ -0,0 +1,103 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a config + google.cloud.gcp_runtimeconfig_config: + name: "{{ resource_name }}" + description: My config + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a config + google.cloud.gcp_runtimeconfig_config: + name: "{{ resource_name }}" + description: My config + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that config was created + google.cloud.gcp_runtimeconfig_config_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloudruntimeconfig + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a config that already exists + google.cloud.gcp_runtimeconfig_config: + name: "{{ resource_name }}" + description: My config + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a config + google.cloud.gcp_runtimeconfig_config: + name: "{{ resource_name }}" + description: My config + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that config was deleted + google.cloud.gcp_runtimeconfig_config_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloudruntimeconfig + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a config that does not exist + google.cloud.gcp_runtimeconfig_config: + name: "{{ resource_name }}" + description: My config + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_config/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/tasks/autogen.yml new file mode 100644 index 00000000..a10f25b6 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/tasks/autogen.yml @@ -0,0 +1,132 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a config + google.cloud.gcp_runtimeconfig_config: + name: my-config + description: My config + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: config +- name: delete a variable + google.cloud.gcp_runtimeconfig_variable: + name: prod-variables/hostname + config: my-config + text: example.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a variable + google.cloud.gcp_runtimeconfig_variable: + name: prod-variables/hostname + config: my-config + text: example.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that variable was created + google.cloud.gcp_runtimeconfig_variable_info: + config: my-config + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloudruntimeconfig + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*prod-variables/hostname.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a variable that already exists + google.cloud.gcp_runtimeconfig_variable: + name: prod-variables/hostname + config: my-config + text: example.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a variable + google.cloud.gcp_runtimeconfig_variable: + name: prod-variables/hostname + config: my-config + text: example.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that variable was deleted + google.cloud.gcp_runtimeconfig_variable_info: + config: my-config + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloudruntimeconfig + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*prod-variables/hostname.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a variable that does not exist + google.cloud.gcp_runtimeconfig_variable: + name: prod-variables/hostname + config: my-config + text: example.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a config + google.cloud.gcp_runtimeconfig_config: + name: my-config + description: My config + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: config + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_runtimeconfig_variable/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/tasks/autogen.yml new file mode 100644 index 00000000..fa47308e --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/tasks/autogen.yml @@ -0,0 +1,98 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a service + google.cloud.gcp_serviceusage_service: + name: spanner.googleapis.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a service + google.cloud.gcp_serviceusage_service: + name: spanner.googleapis.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that service was created + google.cloud.gcp_serviceusage_service_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - "'{{ (results['resources'] | selectattr('name', 'search', 'spanner.googleapis.com') | list | first).state }}' == 'ENABLED'" +# ---------------------------------------------------------------------------- +- name: create a service that already exists + google.cloud.gcp_serviceusage_service: + name: spanner.googleapis.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a service + google.cloud.gcp_serviceusage_service: + name: spanner.googleapis.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that service was deleted + google.cloud.gcp_serviceusage_service_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - "'{{ (results['resources'] | selectattr('name', 'search', 'spanner.googleapis.com') | list | first).state }}' == 'DISABLED'" +# ---------------------------------------------------------------------------- +- name: delete a service that does not exist + google.cloud.gcp_serviceusage_service: + name: spanner.googleapis.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_serviceusage_service/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/tasks/autogen.yml new file mode 100644 index 00000000..f6bd018b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/tasks/autogen.yml @@ -0,0 +1,98 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a repository + google.cloud.gcp_sourcerepo_repository: + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a repository + google.cloud.gcp_sourcerepo_repository: + name: "{{ 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: + that: + - result.changed == true +- name: verify that repository was created + google.cloud.gcp_sourcerepo_repository_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a repository that already exists + google.cloud.gcp_sourcerepo_repository: + name: "{{ 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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a repository + google.cloud.gcp_sourcerepo_repository: + name: "{{ 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: + that: + - result.changed == true +- name: verify that repository was deleted + google.cloud.gcp_sourcerepo_repository_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a repository that does not exist + google.cloud.gcp_sourcerepo_repository: + name: "{{ 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: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sourcerepo_repository/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/tasks/autogen.yml new file mode 100644 index 00000000..8a0f05b5 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/tasks/autogen.yml @@ -0,0 +1,135 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a instance + google.cloud.gcp_spanner_instance: + name: instance-database + 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: instance +- name: delete a database + google.cloud.gcp_spanner_database: + name: webstore + instance: "{{ instance }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a database + google.cloud.gcp_spanner_database: + name: webstore + instance: "{{ instance }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that database was created + google.cloud.gcp_spanner_database_info: + instance: "{{ instance }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/spanner.admin + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*webstore.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a database that already exists + google.cloud.gcp_spanner_database: + name: webstore + instance: "{{ instance }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a database + google.cloud.gcp_spanner_database: + name: webstore + instance: "{{ instance }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that database was deleted + google.cloud.gcp_spanner_database_info: + instance: "{{ instance }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/spanner.admin + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*webstore.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a database that does not exist + google.cloud.gcp_spanner_database: + name: webstore + instance: "{{ instance }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a instance + google.cloud.gcp_spanner_instance: + name: instance-database + 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: instance + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_database/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/tasks/autogen.yml new file mode 100644 index 00000000..2dac9826 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/tasks/autogen.yml @@ -0,0 +1,123 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a instance + google.cloud.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: create a instance + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that instance was created + google.cloud.gcp_spanner_instance_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/spanner.admin + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*testinstance.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a instance that already exists + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a instance + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that instance was deleted + google.cloud.gcp_spanner_instance_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/spanner.admin + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*testinstance.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a instance that does not exist + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_spanner_instance/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/tasks/autogen.yml new file mode 100644 index 00000000..38ed6655 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/tasks/autogen.yml @@ -0,0 +1,144 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a instance + google.cloud.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 + register: instance +- name: delete a database + google.cloud.gcp_sql_database: + name: "{{ resource_name }}" + charset: utf8 + instance: "{{ instance.name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a database + google.cloud.gcp_sql_database: + name: "{{ resource_name }}" + charset: utf8 + instance: "{{ instance.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: + that: + - result.changed == true +- name: verify that database was created + google.cloud.gcp_sql_database_info: + instance: "{{ instance.name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/sqlservice.admin + register: results +- name: verify that command succeeded + assert: + that: + - "\"{{resource_name}}\" in \"{{ results['resources'] | map(attribute='name') | list }}\"" +# ---------------------------------------------------------------------------- +- name: create a database that already exists + google.cloud.gcp_sql_database: + name: "{{ resource_name }}" + charset: utf8 + instance: "{{ instance.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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a database + google.cloud.gcp_sql_database: + name: "{{ resource_name }}" + charset: utf8 + instance: "{{ instance.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: + that: + - result.changed == true +- name: verify that database was deleted + google.cloud.gcp_sql_database_info: + instance: "{{ instance.name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/sqlservice.admin + register: results +- name: verify that command succeeded + assert: + that: + - "\"{{resource_name}}\" not in \"{{ results['resources'] | map(attribute='name') | list }}\"" +# ---------------------------------------------------------------------------- +- name: delete a database that does not exist + google.cloud.gcp_sql_database: + name: "{{ resource_name }}" + charset: utf8 + instance: "{{ instance.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: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a instance + google.cloud.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 + register: instance + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_database/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/tasks/autogen.yml new file mode 100644 index 00000000..2327e012 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/tasks/autogen.yml @@ -0,0 +1,133 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a instance + google.cloud.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: create a instance + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that instance was created + google.cloud.gcp_sql_instance_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/sqlservice.admin + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{resource_name}}-2.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a instance that already exists + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a instance + google.cloud.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 + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that instance was deleted + google.cloud.gcp_sql_instance_info: + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/sqlservice.admin + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{resource_name}}-2.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a instance that does not exist + google.cloud.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 + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_instance/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/tasks/autogen.yml new file mode 100644 index 00000000..27125f08 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/tasks/autogen.yml @@ -0,0 +1,87 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a instance + google.cloud.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 + register: instance +- name: delete a SSL cert + google.cloud.gcp_sql_ssl_cert: + common_name: "{{resource_name}}" + instance: "{{instance['name'}}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a SSL cert + google.cloud.gcp_sql_ssl_cert: + common_name: "{{resource_name}}" + instance: "{{instance['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: + that: + # SslCert is not altered, just verified. + - result.changed == false +- name: verify that ssl_cert was created + google.cloud.gcp_sql_ssl_cert_info: + filters: + - name = + instance: "{{instance['name'}}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/sqlservice.admin + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | length == 1 +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a instance + google.cloud.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 + register: instance + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_ssl_cert/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/tasks/autogen.yml new file mode 100644 index 00000000..b49e85db --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/tasks/autogen.yml @@ -0,0 +1,149 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a instance + google.cloud.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 + register: instance +- name: delete a user + google.cloud.gcp_sql_user: + name: test-user + host: 10.1.2.3 + password: secret-password + instance: "{{ instance }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a user + google.cloud.gcp_sql_user: + name: test-user + host: 10.1.2.3 + password: secret-password + instance: "{{ instance }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that user was created + google.cloud.gcp_sql_user_info: + instance: "{{ instance }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/sqlservice.admin + register: results +- name: verify that command succeeded + assert: + that: + - "'test-user' in \"{{ results['resources'] | map(attribute='name') | list }}\"" +# ---------------------------------------------------------------------------- +- name: create a user that already exists + google.cloud.gcp_sql_user: + name: test-user + host: 10.1.2.3 + password: secret-password + instance: "{{ instance }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a user + google.cloud.gcp_sql_user: + name: test-user + host: 10.1.2.3 + password: secret-password + instance: "{{ instance }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that user was deleted + google.cloud.gcp_sql_user_info: + instance: "{{ instance }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/sqlservice.admin + register: results +- name: verify that command succeeded + assert: + that: + - "'test-user' not in \"{{ results['resources'] | map(attribute='name') | list }}\"" +# ---------------------------------------------------------------------------- +- name: delete a user that does not exist + google.cloud.gcp_sql_user: + name: test-user + host: 10.1.2.3 + password: secret-password + instance: "{{ instance }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a instance + google.cloud.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 + register: instance + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_sql_user/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/tasks/autogen.yml new file mode 100644 index 00000000..e1948754 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/tasks/autogen.yml @@ -0,0 +1,74 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a bucket + google.cloud.gcp_storage_bucket: + name: ansible-storage-module + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a bucket + google.cloud.gcp_storage_bucket: + name: ansible-storage-module + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +# ---------------------------------------------------------------------------- +- name: create a bucket that already exists + google.cloud.gcp_storage_bucket: + name: ansible-storage-module + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a bucket + google.cloud.gcp_storage_bucket: + name: ansible-storage-module + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +# ---------------------------------------------------------------------------- +- name: delete a bucket that does not exist + google.cloud.gcp_storage_bucket: + name: ansible-storage-module + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/tasks/autogen.yml new file mode 100644 index 00000000..e6454ad7 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/tasks/autogen.yml @@ -0,0 +1,104 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a bucket + google.cloud.gcp_storage_bucket: + 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 + google.cloud.gcp_storage_bucket_access_control: + bucket: "{{ bucket }}" + 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 + google.cloud.gcp_storage_bucket_access_control: + bucket: "{{ bucket }}" + 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: + that: + - result.changed == true +# ---------------------------------------------------------------------------- +- name: create a bucket access control that already exists + google.cloud.gcp_storage_bucket_access_control: + bucket: "{{ bucket }}" + 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: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a bucket access control + google.cloud.gcp_storage_bucket_access_control: + bucket: "{{ bucket }}" + 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: + that: + - result.changed == true +# ---------------------------------------------------------------------------- +- name: delete a bucket access control that does not exist + google.cloud.gcp_storage_bucket_access_control: + bucket: "{{ bucket }}" + 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: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a bucket + google.cloud.gcp_storage_bucket: + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: bucket + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_bucket_access_control/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/tasks/autogen.yml new file mode 100644 index 00000000..23fa112f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/tasks/autogen.yml @@ -0,0 +1,99 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: create a bucket + google.cloud.gcp_storage_bucket: + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: bucket +- name: delete a default object acl + google.cloud.gcp_storage_default_object_acl: + bucket: "{{ bucket }}" + entity: OWNER:user-alexstephen@google.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a default object acl + google.cloud.gcp_storage_default_object_acl: + bucket: "{{ bucket }}" + entity: OWNER:user-alexstephen@google.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +# ---------------------------------------------------------------------------- +- name: create a default object acl that already exists + google.cloud.gcp_storage_default_object_acl: + bucket: "{{ bucket }}" + entity: OWNER:user-alexstephen@google.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a default object acl + google.cloud.gcp_storage_default_object_acl: + bucket: "{{ bucket }}" + entity: OWNER:user-alexstephen@google.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +# ---------------------------------------------------------------------------- +- name: delete a default object acl that does not exist + google.cloud.gcp_storage_default_object_acl: + bucket: "{{ bucket }}" + entity: OWNER:user-alexstephen@google.com + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#--------------------------------------------------------- +# Post-test teardown +# If errors happen, don't crash the playbook! +- name: delete a bucket + google.cloud.gcp_storage_bucket: + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: bucket + ignore_errors: true diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_default_object_acl/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_object/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_object/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_object/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_object/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_object/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_object/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_object/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_object/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_object/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_object/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_object/tasks/main.yml new file mode 100644 index 00000000..497d425a --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_storage_object/tasks/main.yml @@ -0,0 +1,75 @@ +--- +# Pre-test setup +- name: create a temp file for uploading + tempfile: + state: file + register: upload_temp +- name: create a temp file for downloading + tempfile: + state: file + register: download_temp +- name: put content in the tempfile + copy: + content: "Ansible GCS test file" + dest: "{{ upload_temp.path }}" +- name: create a bucket + google.cloud.gcp_storage_bucket: + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: bucket +#---------------------------------------------------------- +- name: upload the object to gcs + google.cloud.gcp_storage_object: + action: 'upload' + bucket: "{{ bucket.name }}" + src: "{{ upload_temp.path }}" + dest: "ansible/{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +# ---------------------------------------------------------------------------- +- name: download the object to disk + google.cloud.gcp_storage_object: + action: 'download' + bucket: "{{ bucket.name }}" + src: "ansible/{{ resource_name }}" + dest: "{{ download_temp.path }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +# ---------------------------------------------------------------------------- +- name: delete the object + google.cloud.gcp_storage_object: + action: 'delete' + bucket: "{{ bucket.name }}" + src: "ansible/{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +# ---------------------------------------------------------------------------- +- name: delete the bucket + google.cloud.gcp_storage_bucket: + name: "{{ resource_name }}" + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: bucket diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/aliases b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/aliases new file mode 100644 index 00000000..9812f019 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/aliases @@ -0,0 +1,2 @@ +cloud/gcp +unsupported diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/defaults/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/defaults/main.yml new file mode 100644 index 00000000..ba66644f --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/defaults/main.yml @@ -0,0 +1,2 @@ +--- +resource_name: "{{ resource_prefix }}" diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/meta/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/meta/main.yml new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/meta/main.yml diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/tasks/autogen.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/tasks/autogen.yml new file mode 100644 index 00000000..61a7f5d9 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/tasks/autogen.yml @@ -0,0 +1,120 @@ +--- +# ---------------------------------------------------------------------------- +# +# *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** +# +# ---------------------------------------------------------------------------- +# +# This file is automatically generated by Magic Modules and manual +# changes will be clobbered when the file is regenerated. +# +# Please read more about how to change this file at +# https://www.github.com/GoogleCloudPlatform/magic-modules +# +# ---------------------------------------------------------------------------- +# Pre-test setup +- name: delete a node + google.cloud.gcp_tpu_node: + name: "{{ resource_name }}" + zone: us-central1-b + accelerator_type: v3-8 + tensorflow_version: '1.11' + cidr_block: 10.2.0.0/29 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent +#---------------------------------------------------------- +- name: create a node + google.cloud.gcp_tpu_node: + name: "{{ resource_name }}" + zone: us-central1-b + accelerator_type: v3-8 + tensorflow_version: '1.11' + cidr_block: 10.2.0.0/29 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that node was created + google.cloud.gcp_tpu_node_info: + zone: us-central1-b + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 +# ---------------------------------------------------------------------------- +- name: create a node that already exists + google.cloud.gcp_tpu_node: + name: "{{ resource_name }}" + zone: us-central1-b + accelerator_type: v3-8 + tensorflow_version: '1.11' + cidr_block: 10.2.0.0/29 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: present + register: result +- name: assert changed is false + assert: + that: + - result.changed == false +#---------------------------------------------------------- +- name: delete a node + google.cloud.gcp_tpu_node: + name: "{{ resource_name }}" + zone: us-central1-b + accelerator_type: v3-8 + tensorflow_version: '1.11' + cidr_block: 10.2.0.0/29 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is true + assert: + that: + - result.changed == true +- name: verify that node was deleted + google.cloud.gcp_tpu_node_info: + zone: us-central1-b + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + scopes: + - https://www.googleapis.com/auth/cloud-platform + register: results +- name: verify that command succeeded + assert: + that: + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0 +# ---------------------------------------------------------------------------- +- name: delete a node that does not exist + google.cloud.gcp_tpu_node: + name: "{{ resource_name }}" + zone: us-central1-b + accelerator_type: v3-8 + tensorflow_version: '1.11' + cidr_block: 10.2.0.0/29 + project: "{{ gcp_project }}" + auth_kind: "{{ gcp_cred_kind }}" + service_account_file: "{{ gcp_cred_file }}" + state: absent + register: result +- name: assert changed is false + assert: + that: + - result.changed == false diff --git a/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/tasks/main.yml b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/tasks/main.yml new file mode 100644 index 00000000..45d6e491 --- /dev/null +++ b/collections-debian-merged/ansible_collections/google/cloud/tests/integration/targets/gcp_tpu_node/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: autogen.yml |