Assert all environment variables are not empty.
This commit is contained in:
parent
900cefc119
commit
56fc8f188f
@ -12,20 +12,19 @@
|
||||
with_items:
|
||||
- KEY
|
||||
- DOC_KEY
|
||||
|
||||
- name: Assert environment variable is not empty
|
||||
ansible.builtin.include_tasks: "tasks/assert_env_var_not_empty.yml"
|
||||
with_items:
|
||||
- OS_AUTH_URL
|
||||
- OS_IDENTITY_API_VERSION
|
||||
- OS_TENANT_NAME
|
||||
- OS_USERNAME
|
||||
- OS_PASSWORD
|
||||
- OS_REGION_NAME
|
||||
- SECRETS_ARCHIVE_PASSPHRASE
|
||||
- DUPLICITY_PASSPHRASE
|
||||
|
||||
- name: Assert SECRETS_ARCHIVE_PASSPHRASE environment variable is set
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- lookup('env','SECRETS_ARCHIVE_PASSPHRASE') | length > 0
|
||||
msg: "SECRETS_ARCHIVE_PASSPHRASE environment variable must be set"
|
||||
|
||||
- name: Assert OS_AUTH_URL environment variable is set
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- lookup('env','OS_AUTH_URL') | length > 0
|
||||
msg: "OS_AUTH_URL environment variable must be set"
|
||||
|
||||
|
||||
- name: Download secrets.tar.gz.enc
|
||||
ansible.builtin.get_url:
|
||||
url: "https://{{ CLOUD_SERVER }}/s/{{ KEY }}/download?path=%2F&files=secrets.tar.gz.enc"
|
||||
|
6
tasks/assert_env_var_not_empty.yml
Executable file
6
tasks/assert_env_var_not_empty.yml
Executable file
@ -0,0 +1,6 @@
|
||||
---
|
||||
- name: Assert {{ item }} environment variable is set
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- lookup('env','{{ item }}') | length > 0
|
||||
msg: "{{ item }} environment variable must be set"
|
Loading…
Reference in New Issue
Block a user