Ryan Brown 2018-10-18 10:55:42 -04:00 committed by Alex Stephen
commit 5c97cc1da0
78 changed files with 2531 additions and 1137 deletions

View file

@ -53,7 +53,7 @@
gcp_container_node_pool_facts:
filters:
- name = {{ resource_name }}
cluster: {{ cluster }}
cluster: "{{ cluster }}"
zone: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
@ -101,7 +101,7 @@
gcp_container_node_pool_facts:
filters:
- name = {{ resource_name }}
cluster: {{ cluster }}
cluster: "{{ cluster }}"
zone: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"

View file

@ -39,13 +39,18 @@
- result.changed == true
- "result.kind == 'dns#managedZone'"
- name: verify that managed_zone was created
shell: |
gcloud dns managed-zones describe --project="{{ gcp_project }}" "{{ resource_name }}"
gcp_dns_managed_zone_facts:
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.rc == 0
- results['items'] | length == 1
# ----------------------------------------------------------------------------
- name: create a managed zone that already exists
gcp_dns_managed_zone:
@ -79,15 +84,18 @@
- result.changed == true
- result.has_key('kind') == False
- name: verify that managed_zone was deleted
shell: |
gcloud dns managed-zones describe --project="{{ gcp_project }}" "{{ resource_name }}"
gcp_dns_managed_zone_facts:
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
failed_when: results.rc == 0
- name: verify that command succeeded
assert:
that:
- results.rc == 1
- "\"{{ resource_name }} was not found.\" in results.stderr"
- results['items'] | length == 0
# ----------------------------------------------------------------------------
- name: delete a managed zone that does not exist
gcp_dns_managed_zone:

View file

@ -56,6 +56,19 @@
that:
- result.changed == true
- "result.kind == 'dns#resourceRecordSet'"
- name: verify that resource_record_set was created
gcp_dns_resource_record_set_facts:
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:
- results['items'] | length >= 2
# ----------------------------------------------------------------------------
- name: create a resource record set that already exists
gcp_dns_resource_record_set:
@ -96,6 +109,19 @@
that:
- result.changed == true
- result.has_key('kind') == False
- name: verify that resource_record_set was deleted
gcp_dns_resource_record_set_facts:
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:
- results['items'] | length >= 2
# ----------------------------------------------------------------------------
- name: delete a resource record set that does not exist
gcp_dns_resource_record_set:

View file

@ -50,13 +50,17 @@
that:
- result.changed == true
- name: verify that subscription was created
shell: |
gcloud beta pubsub subscriptions list --project="{{ gcp_project}}" | grep "{{ resource_name }}" | grep 'test-topic1'
gcp_pubsub_subscription_facts:
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:
- results.rc == 0
- results['items'] | length == 1
# ----------------------------------------------------------------------------
- name: create a subscription that already exists
gcp_pubsub_subscription:
@ -92,15 +96,17 @@
that:
- result.changed == true
- name: verify that subscription was deleted
shell: |
gcloud beta pubsub subscriptions list --project="{{ gcp_project}}" | grep "{{ resource_name }}" | grep 'test-topic1'
gcp_pubsub_subscription_facts:
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
scopes:
- https://www.googleapis.com/auth/pubsub
register: results
failed_when: results.rc == 0
- name: verify that command succeeded
assert:
that:
- results.rc == 1
- "\"{{ resource_name }} was not found.\" in results.stderr"
- results['items'] | length == 0
# ----------------------------------------------------------------------------
- name: delete a subscription that does not exist
gcp_pubsub_subscription:

View file

@ -34,13 +34,17 @@
that:
- result.changed == true
- name: verify that topic was created
shell: |
gcloud beta pubsub topics list --project="{{ gcp_project}}"| grep 'topic: projects/.*/test-topic1'
gcp_pubsub_topic_facts:
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:
- results.rc == 0
- results['items'] | length == 1
# ----------------------------------------------------------------------------
- name: create a topic that already exists
gcp_pubsub_topic:
@ -68,15 +72,17 @@
that:
- result.changed == true
- name: verify that topic was deleted
shell: |
gcloud beta pubsub topics list --project="{{ gcp_project}}"| grep 'topic: projects/.*/test-topic1'
gcp_pubsub_topic_facts:
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
scopes:
- https://www.googleapis.com/auth/pubsub
register: results
failed_when: results.rc == 0
- name: verify that command succeeded
assert:
that:
- results.rc == 1
- "\"{{ resource_name }} was not found.\" in results.stderr"
- results['items'] | length == 0
# ----------------------------------------------------------------------------
- name: delete a topic that does not exist
gcp_pubsub_topic:

View file

@ -59,7 +59,7 @@
gcp_sql_user_facts:
filters:
- name = test-user
instance: {{ instance }}
instance: "{{ instance }}"
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
@ -108,7 +108,7 @@
gcp_sql_user_facts:
filters:
- name = test-user
instance: {{ instance }}
instance: "{{ instance }}"
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"