Skip to content

Commit

Permalink
Merge pull request #28 from trento-project/fix-secrets-generation
Browse files Browse the repository at this point in the history
Fix container secrets random generation
  • Loading branch information
arbulu89 authored Feb 21, 2024
2 parents 4694a34 + 3f903bb commit 2445096
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions roles/containers/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ wanda_postgres_db: wandadb
rabbitmq_username: trento
rabbitmq_host: host.docker.internal
rabbitmq_vhost: "trento"
secret_key_base: "{{ lookup('community.general.random_string', base64=True, length=64) }}"
access_token_secret: "{{ lookup('community.general.random_string', base64=True, length=64) }}"
refresh_token_secret: "{{ lookup('community.general.random_string', base64=True, length=64) }}"
secret_key_base: ""
access_token_secret: ""
refresh_token_secret: ""
web_admin_username: admin
enable_api_key: "true"
enable_charts: "true"
Expand Down
10 changes: 10 additions & 0 deletions roles/containers/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# code: language=ansible
---
- name: Create secrets
no_log: true
ansible.builtin.set_fact: # noqa: var-naming[no-jinja]
"{{ item }}": "{{ lookup('community.general.random_string', base64=True, length=64) }}"
when: lookup('vars', item) == ""
loop:
- secret_key_base
- access_token_secret
- refresh_token_secret

- name: Install docker python management deps
ansible.builtin.pip:
name:
Expand Down

0 comments on commit 2445096

Please sign in to comment.