The Last of the Facts Modules

<!-- This change is generated by MagicModules. -->
/cc @rambleraptor
This commit is contained in:
The Magician 2018-10-16 14:26:12 -07:00 committed by Alex Stephen
commit 748132a695
18 changed files with 1195 additions and 1210 deletions

View file

@ -15,35 +15,35 @@
# Pre-test setup
- name: delete a cluster
gcp_container_cluster:
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: absent
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
zone: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: absent
#----------------------------------------------------------
- name: create a cluster
gcp_container_cluster:
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: present
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
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:
@ -51,7 +51,7 @@
- result.changed == true
- name: verify that cluster was created
gcp_container_cluster_facts:
location: us-central1-a
zone: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
@ -61,23 +61,23 @@
- name: verify that command succeeded
assert:
that:
- "'my-cluster' in \"{{ results['items'] | map(attribute='name') | list }}\""
- results['items'] | length >= 1
# ----------------------------------------------------------------------------
- name: create a cluster that already exists
gcp_container_cluster:
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: present
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
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:
@ -86,19 +86,19 @@
#----------------------------------------------------------
- name: delete a cluster
gcp_container_cluster:
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: absent
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
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:
@ -106,7 +106,7 @@
- result.changed == true
- name: verify that cluster was deleted
gcp_container_cluster_facts:
location: us-central1-a
zone: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
@ -116,23 +116,23 @@
- name: verify that command succeeded
assert:
that:
- "'my-cluster' not in \"{{ results['items'] | map(attribute='name') | list }}\""
- results['items'] | length == 0
# ----------------------------------------------------------------------------
- name: delete a cluster that does not exist
gcp_container_cluster:
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: absent
name: my-cluster
initial_node_count: 2
master_auth:
username: cluster_admin
password: my-secret-password
node_config:
machine_type: n1-standard-4
disk_size_gb: 500
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:

View file

@ -25,25 +25,25 @@
register: cluster
- name: delete a node pool
gcp_container_node_pool:
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: absent
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
zone: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: absent
#----------------------------------------------------------
- name: create a node pool
gcp_container_node_pool:
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: present
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
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:
@ -51,8 +51,6 @@
- result.changed == true
- name: verify that node_pool was created
gcp_container_node_pool_facts:
filters:
- name = {{ resource_name }}
cluster: "{{ cluster }}"
zone: us-central1-a
project: "{{ gcp_project }}"
@ -64,18 +62,18 @@
- name: verify that command succeeded
assert:
that:
- "'my-pool' in \"{{ results['items'] | map(attribute='name') | list }}\""
- results['items'] | length >= 1
# ----------------------------------------------------------------------------
- name: create a node pool that already exists
gcp_container_node_pool:
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: present
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
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:
@ -84,14 +82,14 @@
#----------------------------------------------------------
- name: delete a node pool
gcp_container_node_pool:
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: absent
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
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:
@ -99,8 +97,6 @@
- result.changed == true
- name: verify that node_pool was deleted
gcp_container_node_pool_facts:
filters:
- name = {{ resource_name }}
cluster: "{{ cluster }}"
zone: us-central1-a
project: "{{ gcp_project }}"
@ -116,14 +112,14 @@
# ----------------------------------------------------------------------------
- name: delete a node pool that does not exist
gcp_container_node_pool:
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
location: us-central1-a
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
service_account_file: "{{ gcp_cred_file }}"
state: absent
name: my-pool
initial_node_count: 4
cluster: "{{ cluster }}"
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:

View file

@ -56,7 +56,7 @@
- name: verify that command succeeded
assert:
that:
- results['items'] | length == 1
- results['items'] | length >= 1
# ----------------------------------------------------------------------------
- name: create a subscription that already exists
gcp_pubsub_subscription:

View file

@ -44,7 +44,7 @@
- name: verify that command succeeded
assert:
that:
- results['items'] | length == 1
- results['items'] | length >= 1
# ----------------------------------------------------------------------------
- name: create a topic that already exists
gcp_pubsub_topic:

View file

@ -60,7 +60,7 @@
- name: verify that command succeeded
assert:
that:
- "'webstore' in \"{{ results['items'] | map(attribute='name') | list }}\""
- results['items'] | length >= 1
# ----------------------------------------------------------------------------
- name: create a database that already exists
gcp_spanner_database:
@ -101,7 +101,7 @@
- name: verify that command succeeded
assert:
that:
- "'webstore' not in \"{{ results['items'] | map(attribute='name') | list }}\""
- results['items'] | length == 0
# ----------------------------------------------------------------------------
- name: delete a database that does not exist
gcp_spanner_database:

View file

@ -54,7 +54,7 @@
- name: verify that command succeeded
assert:
that:
- "\"{{resource_name}}\" in \"{{ results['items'] | map(attribute='name') | list }}\""
- results['items'] | length >= 1
# ----------------------------------------------------------------------------
- name: create a instance that already exists
gcp_spanner_instance:
@ -102,7 +102,7 @@
- name: verify that command succeeded
assert:
that:
- "\"{{resource_name}}\" not in \"{{ results['items'] | map(attribute='name') | list }}\""
- results['items'] | length == 0
# ----------------------------------------------------------------------------
- name: delete a instance that does not exist
gcp_spanner_instance:

View file

@ -65,7 +65,7 @@
- name: verify that command succeeded
assert:
that:
- "\"{{resource_name}}\" in \"{{ results['items'] | map(attribute='name') | list }}\""
- results['items'] | length >= 1
# ----------------------------------------------------------------------------
- name: create a database that already exists
gcp_sql_database:
@ -110,7 +110,7 @@
- name: verify that command succeeded
assert:
that:
- "\"{{resource_name}}\" not in \"{{ results['items'] | map(attribute='name') | list }}\""
- results['items'] | length == 0
# ----------------------------------------------------------------------------
- name: delete a database that does not exist
gcp_sql_database:

View file

@ -59,7 +59,7 @@
- name: verify that command succeeded
assert:
that:
- results['resources'] | length >= 1
- results['items'] | length >= 1
# ----------------------------------------------------------------------------
- name: create a instance that already exists
gcp_sql_instance:
@ -113,7 +113,7 @@
- name: verify that command succeeded
assert:
that:
- results['resources'] | length == 0
- results['items'] | length == 0
# ----------------------------------------------------------------------------
- name: delete a instance that does not exist
gcp_sql_instance:

View file

@ -57,8 +57,6 @@
- "result.kind == 'sql#user'"
- name: verify that user was created
gcp_sql_user_facts:
filters:
- name = test-user
instance: "{{ instance }}"
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"
@ -69,7 +67,7 @@
- name: verify that command succeeded
assert:
that:
- "'test-user' in \"{{ results['items'] | map(attribute='name') | list }}\""
- results['items'] | length >= 1
# ----------------------------------------------------------------------------
- name: create a user that already exists
gcp_sql_user:
@ -106,8 +104,6 @@
- result.has_key('kind') == False
- name: verify that user was deleted
gcp_sql_user_facts:
filters:
- name = test-user
instance: "{{ instance }}"
project: "{{ gcp_project }}"
auth_kind: "{{ gcp_cred_kind }}"