container: Move secrets to its own tasks file
This commit is contained in:
@@ -22,13 +22,9 @@
|
|||||||
loop_control:
|
loop_control:
|
||||||
loop_var: volume
|
loop_var: volume
|
||||||
|
|
||||||
- name: Create secrets for container {{ container_name }}
|
- name: Create secrets
|
||||||
containers.podman.podman_secret:
|
ansible.builtin.include_tasks: secrets.yaml
|
||||||
name: "{{ item.name }}"
|
when: container_secrets | length > 0
|
||||||
data: "{{ item.value | default(lookup('community.general.random_string', special=false, length=128)) }}"
|
|
||||||
skip_existing: "{{ item.value is not defined }}"
|
|
||||||
no_log: true
|
|
||||||
loop: "{{ container_secrets }}"
|
|
||||||
|
|
||||||
- name: Create container service {{ container_name }}
|
- name: Create container service {{ container_name }}
|
||||||
containers.podman.podman_container:
|
containers.podman.podman_container:
|
||||||
|
|||||||
8
roles/container/tasks/secrets.yaml
Normal file
8
roles/container/tasks/secrets.yaml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
---
|
||||||
|
- name: Create secrets for container {{ container_name }}
|
||||||
|
containers.podman.podman_secret:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
data: "{{ item.value | default(lookup('community.general.random_string', special=false, length=128)) }}"
|
||||||
|
skip_existing: "{{ item.value is not defined }}"
|
||||||
|
no_log: true
|
||||||
|
loop: "{{ container_secrets }}"
|
||||||
Reference in New Issue
Block a user