mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-07-24 13:50:30 -07:00
fix: upgrade ansible version, address test and lint errors
This commit is contained in:
parent
c15b47250d
commit
08ada5354d
216 changed files with 4394 additions and 4262 deletions
|
@ -13,7 +13,7 @@
|
|||
#
|
||||
# ----------------------------------------------------------------------------
|
||||
# Pre-test setup
|
||||
- name: create a config
|
||||
- name: Create a config
|
||||
google.cloud.gcp_runtimeconfig_config:
|
||||
name: my-config
|
||||
description: My config
|
||||
|
@ -22,7 +22,7 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: present
|
||||
register: config
|
||||
- name: delete a variable
|
||||
- name: Delete a variable
|
||||
google.cloud.gcp_runtimeconfig_variable:
|
||||
name: prod-variables/hostname
|
||||
config: my-config
|
||||
|
@ -32,7 +32,7 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: absent
|
||||
#----------------------------------------------------------
|
||||
- name: create a variable
|
||||
- name: Create a variable
|
||||
google.cloud.gcp_runtimeconfig_variable:
|
||||
name: prod-variables/hostname
|
||||
config: my-config
|
||||
|
@ -42,25 +42,25 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: present
|
||||
register: result
|
||||
- name: assert changed is true
|
||||
assert:
|
||||
- name: Assert changed is true
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.changed == true
|
||||
- name: verify that variable was created
|
||||
- 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 | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/cloudruntimeconfig
|
||||
config: my-config
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/cloudruntimeconfig
|
||||
register: results
|
||||
- name: verify that command succeeded
|
||||
assert:
|
||||
- name: Verify that command succeeded
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- results['resources'] | map(attribute='name') | select("match", ".*prod-variables/hostname.*") | list | length == 1
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: create a variable that already exists
|
||||
- name: Create a variable that already exists
|
||||
google.cloud.gcp_runtimeconfig_variable:
|
||||
name: prod-variables/hostname
|
||||
config: my-config
|
||||
|
@ -70,12 +70,12 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: present
|
||||
register: result
|
||||
- name: assert changed is false
|
||||
assert:
|
||||
- name: Assert changed is false
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.changed == false
|
||||
#----------------------------------------------------------
|
||||
- name: delete a variable
|
||||
- name: Delete a variable
|
||||
google.cloud.gcp_runtimeconfig_variable:
|
||||
name: prod-variables/hostname
|
||||
config: my-config
|
||||
|
@ -85,25 +85,25 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: absent
|
||||
register: result
|
||||
- name: assert changed is true
|
||||
assert:
|
||||
- name: Assert changed is true
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.changed == true
|
||||
- name: verify that variable was deleted
|
||||
- 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 | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/cloudruntimeconfig
|
||||
config: my-config
|
||||
project: "{{ gcp_project }}"
|
||||
auth_kind: "{{ gcp_cred_kind }}"
|
||||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
scopes:
|
||||
- https://www.googleapis.com/auth/cloudruntimeconfig
|
||||
register: results
|
||||
- name: verify that command succeeded
|
||||
assert:
|
||||
- name: Verify that command succeeded
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- results['resources'] | map(attribute='name') | select("match", ".*prod-variables/hostname.*") | list | length == 0
|
||||
# ----------------------------------------------------------------------------
|
||||
- name: delete a variable that does not exist
|
||||
- name: Delete a variable that does not exist
|
||||
google.cloud.gcp_runtimeconfig_variable:
|
||||
name: prod-variables/hostname
|
||||
config: my-config
|
||||
|
@ -113,14 +113,14 @@
|
|||
service_account_file: "{{ gcp_cred_file | default(omit) }}"
|
||||
state: absent
|
||||
register: result
|
||||
- name: assert changed is false
|
||||
assert:
|
||||
- name: Assert changed is false
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.changed == false
|
||||
#---------------------------------------------------------
|
||||
# Post-test teardown
|
||||
# If errors happen, don't crash the playbook!
|
||||
- name: delete a config
|
||||
- name: Delete a config
|
||||
google.cloud.gcp_runtimeconfig_config:
|
||||
name: my-config
|
||||
description: My config
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
---
|
||||
- include_tasks: autogen.yml
|
||||
- name: Generated tests
|
||||
ansible.builtin.include_tasks: autogen.yml
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue