You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added folder creation for volumes (containers, not pods)
First it checks if the folder already exists and if it does, it won't
adjust any permissions. This helps if podman can't manage the
permissions correctly.
It allows for changing the owner and group in case it is needed to set a
specific UID and GID.
It also allows to change the mode.
I added explanations for :U as well, which tells podman to change the
permissions to the container user recuresively. This works if the
service inside the container doesn't run with a different user than the
container.
Copy file name to clipboardExpand all lines: README.md
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,11 +19,11 @@ What role does:
19
19
and restarts container if image changed (not for pod yet)
20
20
* creates systemd file for container or pod
21
21
* creates kubernetes yaml for pod
22
+
* creates volume directories for containers if they do not exist. (for pod use DirectoryOrCreate)
22
23
* set's container or pod to be always automatically restarted if container dies.
23
24
* makes container or pod enter run state at system boot
24
25
* adds or removes containers exposed ports to firewall.
25
26
* It takes parameter for running rootless containers under given user
26
-
(I didn't test this with pod mode yet)
27
27
28
28
For reference, see these two blogs about the role:
29
29
*[Automate Podman Containers with Ansible 1/2](https://redhatnordicssa.github.io/ansible-podman-containers-1)
@@ -72,8 +72,16 @@ note that some options apply only to other method.
72
72
-```container_cmd_args``` - Any command and arguments passed to podman-run after specifying the image name. Not used for pod.
73
73
-```container_run_as_user``` - Which user should systemd run container as.
74
74
Defaults to root.
75
-
-```container_run_as_group``` - Which grou should systemd run container as.
75
+
-```container_run_as_group``` - Which group should systemd run container as.
76
76
Defaults to root.
77
+
-```container_dir_owner``` - Which owner should the volume dirs have.
78
+
Defaults to container_run_as_user.
79
+
If you use :U as a volume option podman will set the permissions for the user inside the container automatically.
80
+
Quote: The :U suffix tells Podman to use the correct host UID and GID based on the UID and GID within the container, to change recursively the owner and group of the source volume. Warning use with caution since this will modify the host filesystem.
81
+
-```container_dir_group``` - Which group should the volume dirs have.
82
+
Defaults to container_run_as_group.
83
+
-```container_dir_mode``` - Which permissions should the volume dirs have.
84
+
Defaults to '0755'.
77
85
-```container_state``` - container is installed and run if state is
78
86
```running```, and stopped and systemd file removed if ```absent```
79
87
-```container_firewall_ports``` - list of ports you have exposed from container
0 commit comments