summaryrefslogtreecommitdiffstats
path: root/molecule/debian/Dockerfile.j2
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2025-12-11 14:23:56 +0100
committerAhmed Abdelhalim <[email protected]>2025-12-11 14:25:39 +0100
commita2a191770cc68371228bfba036ef8363fc11ee3c (patch)
treebb2df2300cb28af028dfe5ebac9c05ae842a0643 /molecule/debian/Dockerfile.j2
parenta4c0d3820db7b638c9f25c208414c29b9f9475e0 (diff)
Update the testing to match real scenario (with passwordless test_group)
The passwordless test_group is required to allow switching users without needing to add the password
Diffstat (limited to 'molecule/debian/Dockerfile.j2')
-rw-r--r--molecule/debian/Dockerfile.j24
1 files changed, 4 insertions, 0 deletions
diff --git a/molecule/debian/Dockerfile.j2 b/molecule/debian/Dockerfile.j2
index 2e047439..3a5642a9 100644
--- a/molecule/debian/Dockerfile.j2
+++ b/molecule/debian/Dockerfile.j2
@@ -20,6 +20,10 @@ RUN rm -f /lib/systemd/system/multi-user.target.wants/getty.target
RUN systemctl enable avahi-daemon \
&& touch /etc/locale.gen
+# Enable passwordless sudo for test_group (created by the user role)
+RUN echo '%test_group ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/test_group && \
+ chmod 0440 /etc/sudoers.d/test_group
+
VOLUME ["/sys/fs/cgroup", "/tmp", "/run", "/opt"]
CMD ["/lib/systemd/systemd"]