mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-09-30 05:23:29 -07:00
Fix jinja templating error in assert
Fixes templating for ansible-2.19.
This commit is contained in:
parent
3fe0212960
commit
ec0a9a3a7c
2 changed files with 24 additions and 32 deletions
|
@ -43,40 +43,36 @@
|
||||||
state: present
|
state: present
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
- name: Retrieve the latest parameter version of a parameter
|
- name: Retrieve the latest parameter version of a parameter
|
||||||
ansible.builtin.debug:
|
ansible.builtin.set_fact:
|
||||||
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, project=gcp_project, auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file | default(omit)) }}"
|
param_value: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, project=gcp_project, auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file) | string }}"
|
||||||
register: result
|
|
||||||
- name: Assert parameter value
|
- name: Assert parameter value
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- result.msg == "ansible lookup test parameter value updated"
|
- param_value is contains("ansible lookup test parameter value updated")
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
- name: Retrieve the specified parameter version of a parameter
|
- name: Retrieve the specified parameter version of a parameter
|
||||||
ansible.builtin.debug:
|
ansible.builtin.set_fact:
|
||||||
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, version='test_version', project=gcp_project, auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file | default(omit)) }}"
|
param_value: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, version='test_version', project=gcp_project, auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file) | string }}"
|
||||||
register: result
|
|
||||||
- name: Assert parameter value
|
- name: Assert parameter value
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- result.msg == "ansible lookup test parameter value"
|
- param_value is contains("ansible lookup test parameter value")
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
- name: Render the latest parameter version of a parameter
|
- name: Render the latest parameter version of a parameter
|
||||||
ansible.builtin.debug:
|
ansible.builtin.set_fact:
|
||||||
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, project=gcp_project, auth_kind=gcp_cred_kind, render_secret=True, service_account_file=gcp_cred_file | default(omit)) }}"
|
param_value: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, project=gcp_project, auth_kind=gcp_cred_kind, render_secret=True, service_account_file=gcp_cred_file) | string }}"
|
||||||
register: result
|
|
||||||
- name: Assert parameter value
|
- name: Assert parameter value
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- result.msg == "ansible lookup test parameter value updated"
|
- param_value is contains("ansible lookup test parameter value updated")
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
- name: Render the specified parameter version of a parameter
|
- name: Render the specified parameter version of a parameter
|
||||||
ansible.builtin.debug:
|
ansible.builtin.set_fact:
|
||||||
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, version='test_version', project=gcp_project, auth_kind=gcp_cred_kind, render_secret=True, service_account_file=gcp_cred_file | default(omit)) }}"
|
param_value: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, version='test_version', project=gcp_project, auth_kind=gcp_cred_kind, render_secret=True, service_account_file=gcp_cred_file) | string }}"
|
||||||
register: result
|
|
||||||
- name: Assert parameter value
|
- name: Assert parameter value
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- result.msg == "ansible lookup test parameter value"
|
- param_value is contains ("ansible lookup test parameter value")
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Post-test teardown
|
# Post-test teardown
|
||||||
# If errors happen, don't crash the playbook!
|
# If errors happen, don't crash the playbook!
|
||||||
|
|
|
@ -46,40 +46,36 @@
|
||||||
state: present
|
state: present
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
- name: Retrieve the latest regional parameter version of a regional parameter
|
- name: Retrieve the latest regional parameter version of a regional parameter
|
||||||
ansible.builtin.debug:
|
ansible.builtin.set_fact:
|
||||||
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, project=gcp_project, location='us-central1', auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file | default(omit)) }}"
|
param_value: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, project=gcp_project, location='us-central1', auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file ) | string }}"
|
||||||
register: result
|
|
||||||
- name: Assert regional parameter value
|
- name: Assert regional parameter value
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- result.msg == "ansible lookup test regional parameter value updated"
|
- param_value is contains("ansible lookup test regional parameter value updated")
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
- name: Retrieve the specified regional parameter version of a regional parameter
|
- name: Retrieve the specified regional parameter version of a regional parameter
|
||||||
ansible.builtin.debug:
|
ansible.builtin.set_fact:
|
||||||
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, version='test_version', location='us-central1', project=gcp_project, auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file | default(omit)) }}"
|
param_value: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, version='test_version', location='us-central1', project=gcp_project, auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file) | string }}"
|
||||||
register: result
|
|
||||||
- name: Assert regional parameter value
|
- name: Assert regional parameter value
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- result.msg == "ansible lookup test regional parameter value"
|
- param_value is contains("ansible lookup test regional parameter value")
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
- name: Render the latest regional parameter version of a regional parameter
|
- name: Render the latest regional parameter version of a regional parameter
|
||||||
ansible.builtin.debug:
|
ansible.builtin.set_fact:
|
||||||
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, project=gcp_project, location='us-central1', auth_kind=gcp_cred_kind, render_secret=True, service_account_file=gcp_cred_file | default(omit)) }}"
|
param_value: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, project=gcp_project, location='us-central1', auth_kind=gcp_cred_kind, render_secret=True, service_account_file=gcp_cred_file) | string }}"
|
||||||
register: result
|
|
||||||
- name: Assert regional parameter value
|
- name: Assert regional parameter value
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- result.msg == "ansible lookup test regional parameter value updated"
|
- param_value is contains("ansible lookup test regional parameter value updated")
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
- name: Render the specified regional parameter version of a regional parameter
|
- name: Render the specified regional parameter version of a regional parameter
|
||||||
ansible.builtin.debug:
|
ansible.builtin.set_fact:
|
||||||
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, version='test_version', location='us-central1', project=gcp_project, auth_kind=gcp_cred_kind, render_secret=True, service_account_file=gcp_cred_file | default(omit)) }}"
|
msg: "{{ lookup('google.cloud.gcp_parameter_manager', key=lookup_resource_name, version='test_version', location='us-central1', project=gcp_project, auth_kind=gcp_cred_kind, render_secret=True, service_account_file=gcp_cred_file) | string }}"
|
||||||
register: result
|
|
||||||
- name: Assert regional parameter value
|
- name: Assert regional parameter value
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- result.msg == "ansible lookup test regional parameter value"
|
- param_value is contains("ansible lookup test regional parameter value")
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Post-test teardown
|
# Post-test teardown
|
||||||
# If errors happen, don't crash the playbook!
|
# If errors happen, don't crash the playbook!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue