Build Windows Templates in RHV
This commit is contained in:
37
roles/ikke_t.podman_container_systemd/tasks/check_subid.yml
Normal file
37
roles/ikke_t.podman_container_systemd/tasks/check_subid.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
---
|
||||
|
||||
- name: check if user is in subuid file
|
||||
find:
|
||||
path: /etc/subuid
|
||||
contains: '^{{ container_run_as_user }}:.*$'
|
||||
register: uid_line_found
|
||||
when: container_run_as_user != 'root'
|
||||
|
||||
- name: check if group is in subgid file
|
||||
find:
|
||||
path: /etc/subgid
|
||||
contains: '^{{ container_run_as_group }}:.*$'
|
||||
register: gid_line_found
|
||||
when: container_run_as_group != 'root'
|
||||
|
||||
- name: ensure user is in subuid file, if it was missing
|
||||
lineinfile:
|
||||
path: /etc/subuid
|
||||
regexp: "^{{ container_run_as_user }}:.*"
|
||||
line: "{{ container_run_as_user }}:165536:65536"
|
||||
create: true
|
||||
mode: '0644'
|
||||
owner: root
|
||||
group: root
|
||||
when: container_run_as_user != 'root' and not uid_line_found.matched
|
||||
|
||||
- name: ensure group is in subgid file, if it was missing
|
||||
lineinfile:
|
||||
path: /etc/subgid
|
||||
regexp: "^{{ container_run_as_group }}:.*"
|
||||
line: "{{ container_run_as_group }}:165536:65536"
|
||||
create: true
|
||||
mode: '0644'
|
||||
owner: root
|
||||
group: root
|
||||
when: container_run_as_group != 'root' and not gid_line_found.matched
|
||||
Reference in New Issue
Block a user