Skip to content

Commit 1f7304f

Browse files
committedJan 1, 2025
testing
1 parent 30537cf commit 1f7304f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed
 

‎ansible/playbooks/deploy-docker.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
- name: Deploy application
32
hosts: "{{ target_host }}"
43
vars:
@@ -14,15 +13,18 @@
1413
ansible.builtin.set_fact:
1514
secret_mapping: "{{ secret_mapping_content['content'] | b64decode | from_yaml }}"
1615

16+
- name: Set env_variables
17+
ansible.builtin.set_fact:
18+
env_variables: "{{ secret_mapping[target_host]['env_variables'] | default({}) }}"
19+
1720
- name: Write .env file to target host
1821
ansible.builtin.copy:
1922
dest: "{{ repo_path }}/.env"
2023
content: |
2124
{% for key, secret_id in env_variables.items() %}
22-
{{ key }}={{ lookup('community.general.bws', secret_id, base_url='https://vault.bitwarden.com', access_token=bw_access_token) }}
25+
{{ key }}={{ lookup('community.general.bws', secret_id, base_url='https://vault.bitwarden.com', access_token=lookup('env', 'BW_ACCESS_TOKEN')) }}
2326
{% endfor %}
2427
25-
2628
- name: Verify .env file content
2729
ansible.builtin.shell: cat "{{ repo_path }}/.env"
2830
register: env_file_content

0 commit comments

Comments
 (0)
Please sign in to comment.