Skip to content

Commit f9ec8bb

Browse files
committed
changing ubuntu version on github ci
1 parent a8b4b93 commit f9ec8bb

3 files changed

Lines changed: 20 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ env:
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
2122
jobs:
2223
build-containers:
23-
runs-on: ubuntu-latest
24+
runs-on: ubuntu-22.04
2425
permissions:
2526
contents: read
2627
packages: write

.working/rocky93-ssh/Containerfile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,24 @@ RUN chown 0:0 /usr/bin/sudo && \
3131
RUN 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
3437
RUN 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
3954
RUN mkdir -p /tmp/ansible-jackaltx && \
@@ -89,4 +104,4 @@ RUN echo "umask 027" >> /etc/profile && \
89104
RUN 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/

.working/rocky93-ssh/playbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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:

0 commit comments

Comments
 (0)