Skip to content

Commit b6a88c5

Browse files
authored
Merge pull request #61 from dev-sec/update_all
Include current Linux distributions and remove unsupported versions
2 parents b4f52f0 + 589766d commit b6a88c5

File tree

12 files changed

+335
-92
lines changed

12 files changed

+335
-92
lines changed

.github/workflows/all.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,21 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
dockerimage:
19+
- almalinux8-ansible
20+
- almalinux9-ansible
21+
- almalinux10-ansible
1922
- alpine-ansible
2023
- amazon2-ansible
2124
- amazon2023-ansible
2225
- arch-ansible
23-
- centos7-ansible
24-
- centos8-ansible
2526
- centosstream8-ansible
2627
- centosstream9-ansible
2728
- rocky8-ansible
2829
- rocky9-ansible
29-
- debian10-ansible
30+
- rocky10-ansible
3031
- debian11-ansible
3132
- debian12-ansible
33+
- debian13-ansible
3234
- fedora37-ansible
3335
- fedora38-ansible
3436
- fedora39-ansible

.github/workflows/centos7-ansible-latest.yml renamed to .github/workflows/almalinux10-ansible-latest.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: centos7-ansible-latest
1+
name: almalinux10-ansible-latest
22
on:
33
# yamllint disable-line rule:truthy
44
workflow_dispatch:
55
push:
66
paths:
7-
- 'centos7-ansible-latest/**'
7+
- 'almalinux10-ansible-latest/**'
88
pull_request:
99
paths:
10-
- 'centos7-ansible-latest/**'
10+
- 'almalinux10-ansible-latest/**'
1111
jobs:
1212
docker:
1313
runs-on: ubuntu-latest
@@ -18,10 +18,10 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
dockerimage:
21-
- centos7-ansible
21+
- almalinux10-ansible
2222
platforms:
2323
- linux/amd64
24-
# #- linux/arm64 # not supported upstream
24+
#- linux/arm64
2525
steps:
2626
-
2727
name: Checkout
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: almalinux8-ansible-latest
2+
on:
3+
# yamllint disable-line rule:truthy
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- 'almalinux8-ansible-latest/**'
8+
pull_request:
9+
paths:
10+
- 'almalinux8-ansible-latest/**'
11+
jobs:
12+
docker:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
dockerimage:
21+
- almalinux8-ansible
22+
platforms:
23+
- linux/amd64
24+
#- linux/arm64
25+
steps:
26+
-
27+
name: Checkout
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
29+
-
30+
name: Set up QEMU
31+
uses: docker/setup-qemu-action@v3
32+
-
33+
name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
-
36+
name: Build and export to Docker
37+
uses: docker/build-push-action@v6
38+
with:
39+
context: ${{ matrix.dockerimage }}-latest
40+
tags: docker-${{ matrix.dockerimage }}:test
41+
platforms: ${{ matrix.platforms }}
42+
load: true
43+
-
44+
name: Test
45+
run: |
46+
docker run --rm docker-${{ matrix.dockerimage }}:test
47+
-
48+
name: Login to ghcr.io
49+
uses: docker/login-action@v3
50+
with:
51+
registry: ghcr.io
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
if: github.ref == 'refs/heads/master'
55+
-
56+
name: Build and push to ghcr.io
57+
uses: docker/build-push-action@v6
58+
with:
59+
context: ${{ matrix.dockerimage }}-latest
60+
push: true
61+
tags: ghcr.io/dev-sec/docker-${{ matrix.dockerimage }}:latest
62+
platforms: ${{ matrix.platforms }}
63+
if: github.ref == 'refs/heads/master'
64+
-
65+
name: Login to DockerHub
66+
uses: docker/login-action@v3
67+
with:
68+
username: ${{ secrets.DOCKERHUB_USERNAME }}
69+
password: ${{ secrets.DOCKERHUB_TOKEN }}
70+
if: github.ref == 'refs/heads/master'
71+
-
72+
name: Build and push
73+
uses: docker/build-push-action@v6
74+
with:
75+
context: ${{ matrix.dockerimage }}-latest
76+
push: true
77+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/docker-${{ matrix.dockerimage }}:latest
78+
platforms: ${{ matrix.platforms }}
79+
if: github.ref == 'refs/heads/master'
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: almalinux9-ansible-latest
2+
on:
3+
# yamllint disable-line rule:truthy
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- 'almalinux9-ansible-latest/**'
8+
pull_request:
9+
paths:
10+
- 'almalinux9-ansible-latest/**'
11+
jobs:
12+
docker:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
dockerimage:
21+
- almalinux9-ansible
22+
platforms:
23+
- linux/amd64
24+
#- linux/arm64
25+
steps:
26+
-
27+
name: Checkout
28+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
29+
-
30+
name: Set up QEMU
31+
uses: docker/setup-qemu-action@v3
32+
-
33+
name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
-
36+
name: Build and export to Docker
37+
uses: docker/build-push-action@v6
38+
with:
39+
context: ${{ matrix.dockerimage }}-latest
40+
tags: docker-${{ matrix.dockerimage }}:test
41+
platforms: ${{ matrix.platforms }}
42+
load: true
43+
-
44+
name: Test
45+
run: |
46+
docker run --rm docker-${{ matrix.dockerimage }}:test
47+
-
48+
name: Login to ghcr.io
49+
uses: docker/login-action@v3
50+
with:
51+
registry: ghcr.io
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
if: github.ref == 'refs/heads/master'
55+
-
56+
name: Build and push to ghcr.io
57+
uses: docker/build-push-action@v6
58+
with:
59+
context: ${{ matrix.dockerimage }}-latest
60+
push: true
61+
tags: ghcr.io/dev-sec/docker-${{ matrix.dockerimage }}:latest
62+
platforms: ${{ matrix.platforms }}
63+
if: github.ref == 'refs/heads/master'
64+
-
65+
name: Login to DockerHub
66+
uses: docker/login-action@v3
67+
with:
68+
username: ${{ secrets.DOCKERHUB_USERNAME }}
69+
password: ${{ secrets.DOCKERHUB_TOKEN }}
70+
if: github.ref == 'refs/heads/master'
71+
-
72+
name: Build and push
73+
uses: docker/build-push-action@v6
74+
with:
75+
context: ${{ matrix.dockerimage }}-latest
76+
push: true
77+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/docker-${{ matrix.dockerimage }}:latest
78+
platforms: ${{ matrix.platforms }}
79+
if: github.ref == 'refs/heads/master'

.github/workflows/debian10-ansible-latest.yml renamed to .github/workflows/debian13-ansible-latest.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: debian10-ansible-latest
1+
name: debian13-ansible-latest
22
on:
33
# yamllint disable-line rule:truthy
44
workflow_dispatch:
55
push:
66
paths:
7-
- 'debian10-ansible-latest/**'
7+
- 'debian13-ansible-latest/**'
88
pull_request:
99
paths:
10-
- 'debian10-ansible-latest/**'
10+
- 'debian13-ansible-latest/**'
1111
jobs:
1212
docker:
1313
runs-on: ubuntu-latest
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
dockerimage:
21-
- debian10-ansible
21+
- debian13-ansible
2222
platforms:
2323
- linux/amd64
2424
#- linux/arm64

.github/workflows/centos8-ansible-latest.yml renamed to .github/workflows/rocky10-ansible-latest.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
name: centos8-ansible-latest
1+
name: rocky10-ansible-latest
22
on:
33
# yamllint disable-line rule:truthy
44
workflow_dispatch:
55
push:
66
paths:
7-
- 'centos8-ansible-latest/**'
7+
- 'rocky10-ansible-latest/**'
88
pull_request:
99
paths:
10-
- 'centos8-ansible-latest/**'
10+
- 'rocky10-ansible-latest/**'
1111
jobs:
1212
docker:
1313
runs-on: ubuntu-latest
@@ -18,7 +18,7 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
dockerimage:
21-
- centos8-ansible
21+
- rocky10-ansible
2222
platforms:
2323
- linux/amd64
2424
#- linux/arm64
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM almalinux:10
2+
LABEL maintainer="Sebastian Gumprich"
3+
ENV container=docker
4+
5+
# Install systemd -- See https://hub.docker.com/_/centos/
6+
RUN yum -y update; yum clean all;
7+
8+
# Install Ansible and other requirements.
9+
RUN yum makecache --timer \
10+
&& yum -y install epel-release initscripts \
11+
&& yum -y update \
12+
&& yum -y install \
13+
sudo \
14+
which \
15+
hostname \
16+
python3 \
17+
python3-pip \
18+
&& yum clean all
19+
20+
# upgrade pip because of the rust dependency error
21+
RUN pip3 install --no-cache-dir --upgrade pip && \
22+
pip3 install --no-cache-dir ansible
23+
24+
# Disable requiretty.
25+
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers
26+
27+
# Install Ansible inventory file.
28+
RUN mkdir -p /etc/ansible && \
29+
echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts
30+
31+
# https://molecule.readthedocs.io/en/latest/examples.html#docker-with-non-privileged-user
32+
# Create `ansible` user with sudo permissions and membership in `DEPLOY_GROUP`
33+
# This template gets rendered using `loop: "{{ molecule_yml.platforms }}"`, so
34+
# each `item` is an element of platforms list from the molecule.yml file for this scenario.
35+
ENV ANSIBLE_USER=ansible DEPLOY_GROUP=deployer SUDO_GROUP=wheel
36+
RUN set -xe \
37+
&& groupadd -r ${ANSIBLE_USER} \
38+
&& groupadd -r ${DEPLOY_GROUP} \
39+
&& useradd -m -g ${ANSIBLE_USER} ${ANSIBLE_USER} \
40+
&& usermod -aG ${SUDO_GROUP} ${ANSIBLE_USER} \
41+
&& usermod -aG ${DEPLOY_GROUP} ${ANSIBLE_USER} \
42+
&& sed -i "/^%${SUDO_GROUP}/s/ALL\$/NOPASSWD:ALL/g" /etc/sudoers
43+
44+
# delete file created by systemd that prevents login via ssh
45+
RUN rm -f /{var/run,etc,run}/nologin
46+
47+
VOLUME ["/sys/fs/cgroup"]
48+
CMD [ "ansible-playbook", "--version" ]
Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM centos:8
1+
FROM almalinux:8
22
LABEL maintainer="Sebastian Gumprich"
33
ENV container=docker
44

@@ -14,21 +14,20 @@ RUN yum -y update; yum clean all; \
1414
rm -f /lib/systemd/system/anaconda.target.wants/*;
1515

1616
# Install Ansible and other requirements.
17-
RUN sed -i -e "s|mirrorlist=|#mirrorlist=|g" -e "s|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g" /etc/yum.repos.d/CentOS-Linux-* \
18-
&& yum makecache --timer \
17+
RUN yum makecache --timer \
1918
&& yum -y install epel-release initscripts \
2019
&& yum -y update \
2120
&& yum -y install \
2221
sudo \
2322
which \
2423
hostname \
25-
python3 \
26-
python3-pip \
24+
python3.12 \
25+
python3.12-pip \
2726
&& yum clean all
2827

2928
# upgrade pip because of the rust dependency error
30-
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
31-
pip3 install --no-cache-dir ansible
29+
RUN pip3.12 install --no-cache-dir --upgrade pip && \
30+
pip3.12 install --no-cache-dir ansible
3231

3332
# Disable requiretty.
3433
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM almalinux:9
2+
LABEL maintainer="Sebastian Gumprich"
3+
ENV container=docker
4+
5+
# Install systemd -- See https://hub.docker.com/_/centos/
6+
RUN yum -y update; yum clean all;
7+
8+
# Install Ansible and other requirements.
9+
RUN yum makecache --timer \
10+
&& yum -y install epel-release initscripts \
11+
&& yum -y update \
12+
&& yum -y install \
13+
sudo \
14+
which \
15+
hostname \
16+
python3 \
17+
python3-pip \
18+
&& yum clean all
19+
20+
# upgrade pip because of the rust dependency error
21+
RUN pip3 install --no-cache-dir --upgrade pip && \
22+
pip3 install --no-cache-dir ansible
23+
24+
# Disable requiretty.
25+
RUN sed -i -e 's/^\(Defaults\s*requiretty\)/#--- \1/' /etc/sudoers
26+
27+
# Install Ansible inventory file.
28+
RUN mkdir -p /etc/ansible && \
29+
echo -e '[local]\nlocalhost ansible_connection=local' > /etc/ansible/hosts
30+
31+
# https://molecule.readthedocs.io/en/latest/examples.html#docker-with-non-privileged-user
32+
# Create `ansible` user with sudo permissions and membership in `DEPLOY_GROUP`
33+
# This template gets rendered using `loop: "{{ molecule_yml.platforms }}"`, so
34+
# each `item` is an element of platforms list from the molecule.yml file for this scenario.
35+
ENV ANSIBLE_USER=ansible DEPLOY_GROUP=deployer SUDO_GROUP=wheel
36+
RUN set -xe \
37+
&& groupadd -r ${ANSIBLE_USER} \
38+
&& groupadd -r ${DEPLOY_GROUP} \
39+
&& useradd -m -g ${ANSIBLE_USER} ${ANSIBLE_USER} \
40+
&& usermod -aG ${SUDO_GROUP} ${ANSIBLE_USER} \
41+
&& usermod -aG ${DEPLOY_GROUP} ${ANSIBLE_USER} \
42+
&& sed -i "/^%${SUDO_GROUP}/s/ALL\$/NOPASSWD:ALL/g" /etc/sudoers
43+
44+
# delete file created by systemd that prevents login via ssh
45+
RUN rm -f /{var/run,etc,run}/nologin
46+
47+
VOLUME ["/sys/fs/cgroup"]
48+
CMD [ "ansible-playbook", "--version" ]

0 commit comments

Comments
 (0)