File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 REGISTRY_USER : ${{ github.actor }}
1919 REGISTRY_REPO : testing-containers
2020
21+ # https://docs.github.com/en/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job
2122jobs :
2223 build-containers :
23- runs-on : ubuntu-latest
24+ runs-on : ubuntu-22.04
2425 permissions :
2526 contents : read
2627 packages : write
Original file line number Diff line number Diff line change @@ -31,9 +31,24 @@ RUN chown 0:0 /usr/bin/sudo && \
3131RUN systemctl mask systemd-machine-id-commit.service
3232
3333# Create provisioner user and set up sudo
34+ #
35+ # https://access.redhat.com/solutions/4060861
36+ # Lock the password but ensure shadow entry exists
3437RUN useradd -m -s /bin/bash jackaltx && \
3538 echo "jackaltx ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/jackaltx && \
36- chmod 440 /etc/sudoers.d/jackaltx
39+ chmod 440 /etc/sudoers.d/jackaltx && \
40+ passwd -l jackaltx
41+
42+ # Verify the shadow entry exists and is correct
43+ RUN grep jackaltx /etc/shadow && \
44+ pwck -r
45+
46+ # But we might need to explicitly configure PAM for the container environment
47+ # this is a Rocky on github thing. It cannot use the default user to authenticate.
48+ # Add PAM configuration for sudo
49+ # RUN echo "auth sufficient pam_unix.so" > /etc/pam.d/sudo && \
50+ # echo "account required pam_unix.so" >> /etc/pam.d/sudo && \
51+ # echo "session required pam_unix.so" >> /etc/pam.d/sudo
3752
3853# Create ansible temp directory with proper permissions
3954RUN mkdir -p /tmp/ansible-jackaltx && \
@@ -89,4 +104,4 @@ RUN echo "umask 027" >> /etc/profile && \
89104RUN ls -l /usr/bin/sudo && \
90105 ls -l /etc/sudoers.d/jackaltx && \
91106 id jackaltx && \
92- sudo -l -U jackaltx
107+ grep -r " jackaltx" /etc/sudoers.d/
Original file line number Diff line number Diff line change 11---
22- name : Configure Rocky Linux container
33 hosts : rocky_container
4- gather_facts : yes
4+ gather_facts : no
55 become : yes
66
77 tasks :
You can’t perform that action at this time.
0 commit comments