Add volume role and support setting volume owner
Add volume role container: Use volume role, including support for user and group
This commit is contained in:
11
roles/volume/tasks/main.yaml
Normal file
11
roles/volume/tasks/main.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
- name: Validate inputs
|
||||
ansible.builtin.import_tasks: validation.yaml
|
||||
|
||||
- name: Create container volume service {{ volume_name }}
|
||||
containers.podman.podman_volume:
|
||||
name: "{{ volume_name }}"
|
||||
options: "{{ volume_options }}"
|
||||
state: quadlet
|
||||
quadlet_file_mode: "0644"
|
||||
notify: Reload systemd daemon
|
||||
7
roles/volume/tasks/validation.yaml
Normal file
7
roles/volume/tasks/validation.yaml
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
- name: Assert volume_uid and volume_gid are strings
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- volume_uid is string
|
||||
- volume_gid is string
|
||||
fail_msg: "volume_uid and volume_gid must be strings, not int."
|
||||
Reference in New Issue
Block a user