Skip to content

Commit 5b19d40

Browse files
committedJan 1, 2025
testing
1 parent 1335f6c commit 5b19d40

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed
 

‎.forgejo/workflows/CD.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -156,5 +156,5 @@ jobs:
156156
ANSIBLE_CONFIG: ansible/ansible.cfg
157157
run: |
158158
ansible-playbook -i ansible/hosts.ini ./ansible/playbooks/deploy-docker.yml \
159-
--extra-vars "target_host=${{ env.target_host }} folder=${{ env.folder }}"
159+
--extra-vars "target_host=${{ env.target_host }} folder=${{ env.folder }} bw_access_token=${{ secrets.BW_ACCESS_TOKEN }}"
160160

‎ansible/playbooks/deploy-docker.yml

+7-5
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
ansible.builtin.set_fact:
1515
secret_mapping: "{{ secret_mapping_content['content'] | b64decode | from_yaml }}"
1616

17-
- name: Generate .env content
18-
vars:
19-
env_variables: "{{ secret_mapping[target_host]['env_variables'] | default({}) }}"
20-
ansible.builtin.template:
21-
src: env_template.j2
17+
- name: Write .env file to target host
18+
ansible.builtin.copy:
2219
dest: "{{ repo_path }}/.env"
20+
content: |
21+
{% 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) }}
23+
{% endfor %}
24+
2325
2426
- name: Verify .env file content
2527
ansible.builtin.shell: cat "{{ repo_path }}/.env"

0 commit comments

Comments
 (0)
Please sign in to comment.