mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-09-30 13:33:30 -07:00
Merge pull request #713 from p3ck/gcp_secret_manager-2.19
Fix jinja templating error in assert
This commit is contained in:
commit
8d437f5d89
2 changed files with 12 additions and 16 deletions
|
@ -45,22 +45,20 @@
|
||||||
state: present
|
state: present
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
- name: Retrieve the latest secret version of a regional secret
|
- name: Retrieve the latest secret version of a regional secret
|
||||||
ansible.builtin.debug:
|
ansible.builtin.set_fact:
|
||||||
msg: "{{ lookup('google.cloud.gcp_secret_manager', key=lookup_resource_name, location='us-central1', project=gcp_project, auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file | default(omit)) }}"
|
secret_value: "{{ lookup('google.cloud.gcp_secret_manager', key=lookup_resource_name, location='us-central1', project=gcp_project, auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file) | string }}"
|
||||||
register: result
|
|
||||||
- name: Assert secret value
|
- name: Assert secret value
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- result.msg == "ansible lookup test regional secret value updated"
|
- secret_value is contains("ansible lookup test regional secret value updated")
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
- name: Retrieve the specified secret version of a regional secret
|
- name: Retrieve the specified secret version of a regional secret
|
||||||
ansible.builtin.debug:
|
ansible.builtin.set_fact:
|
||||||
msg: "{{ lookup('google.cloud.gcp_secret_manager', key=lookup_resource_name, location='us-central1', version='1', project=gcp_project, auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file | default(omit)) }}"
|
secret_value: "{{ lookup('google.cloud.gcp_secret_manager', key=lookup_resource_name, location='us-central1', version='1', project=gcp_project, auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file) | string }}"
|
||||||
register: result
|
|
||||||
- name: Assert secret value
|
- name: Assert secret value
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- result.msg == "ansible lookup test regional secret value"
|
- secret_value is contains("ansible lookup test regional secret value")
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Post-test teardown
|
# Post-test teardown
|
||||||
# If errors happen, don't crash the playbook!
|
# If errors happen, don't crash the playbook!
|
||||||
|
|
|
@ -42,22 +42,20 @@
|
||||||
state: present
|
state: present
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
- name: Retrieve the latest secret version of a secret
|
- name: Retrieve the latest secret version of a secret
|
||||||
ansible.builtin.debug:
|
ansible.builtin.set_fact:
|
||||||
msg: "{{ lookup('google.cloud.gcp_secret_manager', key=lookup_resource_name, project=gcp_project, auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file | default(omit)) }}"
|
secret_value: "{{ lookup('google.cloud.gcp_secret_manager', key=lookup_resource_name, project=gcp_project, auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file) | string }}"
|
||||||
register: result
|
|
||||||
- name: Assert secret value
|
- name: Assert secret value
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- result.msg == "ansible lookup test secret value updated"
|
- secret_value is contains("ansible lookup test secret value updated")
|
||||||
# ----------------------------------------------------------
|
# ----------------------------------------------------------
|
||||||
- name: Retrieve the specified secret version of a secret
|
- name: Retrieve the specified secret version of a secret
|
||||||
ansible.builtin.debug:
|
ansible.builtin.set_fact:
|
||||||
msg: "{{ lookup('google.cloud.gcp_secret_manager', key=lookup_resource_name, version='1', project=gcp_project, auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file | default(omit)) }}"
|
secret_value: "{{ lookup('google.cloud.gcp_secret_manager', key=lookup_resource_name, version='1', project=gcp_project, auth_kind=gcp_cred_kind, service_account_file=gcp_cred_file) | string }}"
|
||||||
register: result
|
|
||||||
- name: Assert secret value
|
- name: Assert secret value
|
||||||
ansible.builtin.assert:
|
ansible.builtin.assert:
|
||||||
that:
|
that:
|
||||||
- result.msg == "ansible lookup test secret value"
|
- secret_value is contains("ansible lookup test secret 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