mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-09-29 21:13:30 -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
|
||||
# ----------------------------------------------------------
|
||||
- name: Retrieve the latest parameter version of a parameter
|
||||
ansible.builtin.debug:
|
||||
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)) }}"
|
||||
register: result
|
||||
ansible.builtin.set_fact:
|
||||
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 }}"
|
||||
- name: Assert parameter value
|
||||
ansible.builtin.assert:
|
||||
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
|
||||
ansible.builtin.debug:
|
||||
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)) }}"
|
||||
register: result
|
||||
ansible.builtin.set_fact:
|
||||
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 }}"
|
||||
- name: Assert parameter value
|
||||
ansible.builtin.assert:
|
||||
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
|
||||
ansible.builtin.debug:
|
||||
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)) }}"
|
||||
register: result
|
||||
ansible.builtin.set_fact:
|
||||
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 }}"
|
||||
- name: Assert parameter value
|
||||
ansible.builtin.assert:
|
||||
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
|
||||
ansible.builtin.debug:
|
||||
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)) }}"
|
||||
register: result
|
||||
ansible.builtin.set_fact:
|
||||
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 }}"
|
||||
- name: Assert parameter value
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.msg == "ansible lookup test parameter value"
|
||||
- param_value is contains ("ansible lookup test parameter value")
|
||||
# ---------------------------------------------------------
|
||||
# Post-test teardown
|
||||
# If errors happen, don't crash the playbook!
|
||||
|
|
|
@ -46,40 +46,36 @@
|
|||
state: present
|
||||
# ----------------------------------------------------------
|
||||
- name: Retrieve the latest regional parameter version of a regional parameter
|
||||
ansible.builtin.debug:
|
||||
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)) }}"
|
||||
register: result
|
||||
ansible.builtin.set_fact:
|
||||
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 }}"
|
||||
- name: Assert regional parameter value
|
||||
ansible.builtin.assert:
|
||||
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
|
||||
ansible.builtin.debug:
|
||||
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)) }}"
|
||||
register: result
|
||||
ansible.builtin.set_fact:
|
||||
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 }}"
|
||||
- name: Assert regional parameter value
|
||||
ansible.builtin.assert:
|
||||
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
|
||||
ansible.builtin.debug:
|
||||
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)) }}"
|
||||
register: result
|
||||
ansible.builtin.set_fact:
|
||||
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 }}"
|
||||
- name: Assert regional parameter value
|
||||
ansible.builtin.assert:
|
||||
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
|
||||
ansible.builtin.debug:
|
||||
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)) }}"
|
||||
register: result
|
||||
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) | string }}"
|
||||
- name: Assert regional parameter value
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- result.msg == "ansible lookup test regional parameter value"
|
||||
- param_value is contains("ansible lookup test regional parameter value")
|
||||
# ---------------------------------------------------------
|
||||
# Post-test teardown
|
||||
# If errors happen, don't crash the playbook!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue