Skip to content

Commit 38dc240

Browse files
committed
Drop puppet 6 and add puppet 8 to rocky Dockerfiles
This module requires puppet 7 or greater, so drop references to puppet6 and earlier. Update `puppet module install` to install correct dependencies.
1 parent 5995fa8 commit 38dc240

File tree

4 files changed

+23
-32
lines changed

4 files changed

+23
-32
lines changed

docker/bin/helpers/run-upgrade.sh

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,26 @@
11
#!/usr/bin/env bash
22

3-
# Run upgrades on a container. The default upgrade TO argument will be 6.2.0 if
3+
# Run upgrades on a container. The default upgrade TO argument will be 8.10.0 if
44
# no arguments are passed to this script.
55
set -e
66

7-
to_version=${1:-6.2.0}
7+
to_version=${1:-8.10.0}
88
# Calculate which collection should be used. This is derived from the puppet
99
# version.
1010
puppet_version=( ${to_version//./ } )
1111
puppet_major=${puppet_version[0]}
1212
case $puppet_major in
13-
4)
14-
to_collection=PC1
15-
;;
16-
5)
17-
to_collection=puppet5
18-
;;
19-
6)
20-
to_collection=puppet6
21-
;;
2213
7)
2314
to_collection=puppet7
2415
;;
16+
8)
17+
to_collection=puppet8
18+
;;
2519
*)
2620
echo "Invalid version supplied" 1>&2
2721
exit 1
2822
esac
29-
FACTER_to_version=${1:-6.2.0} FACTER_to_collection=${to_collection} /opt/puppetlabs/puppet/bin/puppet apply --debug --trace --modulepath /tmp/modules /tmp/upgrade.pp
23+
FACTER_to_version=${1:-8.10.0} FACTER_to_collection=${to_collection} /opt/puppetlabs/puppet/bin/puppet apply --debug --trace --modulepath /tmp/modules /tmp/upgrade.pp
3024
# Make e.g. `puppet --version` work out of the box.
3125
PATH=/opt/puppetlabs/bin:$PATH \
3226
read -p "Explore the upgraded container? [y/N]: " choice && \

docker/bin/upgrade.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ set -e
1919

2020
cd "$(dirname "$0")/../.."
2121
platforms=${1:-ubuntu}
22-
before=${2:-1.10.14}
23-
after=${3:-6.2.0}
22+
before=${2:-7.34.0}
23+
after=${3:-8.10.0}
2424
for platform in ${platforms//,/ }
2525
do
2626
docker build --rm -f docker/$platform/Dockerfile . -t pa-dev:$platform \

docker/rocky/Dockerfile

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# This specifies the versions that were used for upgrade.
2323
#
2424
# Arguments:
25-
# - before: The version to do upgrade FROM. Default: "1.10.14"
25+
# - before: The version to do upgrade FROM. Default: "7.34.0"
2626

2727
FROM rockylinux/rockylinux:8
2828

@@ -34,15 +34,11 @@ RUN dnf update -y \
3434
&& dnf install -y wget git \
3535
&& dnf clean all
3636

37-
ARG before=1.10.14
37+
ARG before=7.34.0
3838
LABEL before=${before}
3939

40-
# Install proper FROM repo: puppet 6 or puppet 7.
41-
RUN if [[ ${before} == 6.* ]]; then \
42-
echo Installing puppet6 repo; \
43-
wget -O puppet6.rpm http://yum.puppet.com/puppet6-release-el-8.noarch.rpm && \
44-
rpm -i puppet6.rpm; \
45-
elif [[ ${before} == 7.* ]]; then \
40+
# Install proper FROM repo pupet 7
41+
RUN if [[ ${before} == 7.* ]]; then \
4642
echo Installing puppet7 repo; \
4743
wget -O puppet7.rpm http://yum.puppet.com/puppet7-release-el-8.noarch.rpm && \
4844
rpm -i puppet7.rpm; \
@@ -67,13 +63,14 @@ COPY metadata.json ./
6763
RUN /opt/puppetlabs/puppet/bin/puppet module install --modulepath $module_path --target-dir .. puppetlabs-stdlib
6864
RUN /opt/puppetlabs/puppet/bin/puppet module install --modulepath $module_path --target-dir .. puppetlabs-inifile
6965
RUN /opt/puppetlabs/puppet/bin/puppet module install --modulepath $module_path --target-dir .. puppetlabs-apt
66+
RUN /opt/puppetlabs/puppet/bin/puppet module install --modulepath $module_path --target-dir .. puppetlabs-facts
7067

7168
# Installing dependencies from source. These versions should be within the range
72-
# of `dependencies` in metadata.json. `translate` is a dependency for inifile.
73-
#RUN git clone https://github.com/puppetlabs/puppetlabs-stdlib ../stdlib --branch 5.2.0
74-
#RUN git clone https://github.com/puppetlabs/puppetlabs-inifile ../inifile --branch 2.5.0
75-
#RUN git clone https://github.com/puppetlabs/puppetlabs-translate ../translate --branch 1.2.0
76-
#RUN git clone https://github.com/puppetlabs/puppetlabs-apt ../apt --branch 6.3.0
69+
# of `dependencies` in metadata.json.
70+
#RUN git clone https://github.com/puppetlabs/puppetlabs-stdlib ../stdlib --branch 9.7.0
71+
#RUN git clone https://github.com/puppetlabs/puppetlabs-inifile ../inifile --branch 6.2.0
72+
#RUN git clone https://github.com/puppetlabs/puppetlabs-apt ../apt --branch 10.0.1
73+
#RUN git clone https://github.com/puppetlabs/puppetlabs-facts ../facts --branch 1.7.0
7774

7875
# Check that all dependencies are installed.
7976
RUN /opt/puppetlabs/puppet/bin/puppet module --modulepath $module_path list --tree

docker/rocky/Dockerfile.versions

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ RUN dnf update -y \
55
&& dnf install -y wget git \
66
&& dnf clean all
77

8-
# Install several repos: puppet 6, and puppet7.
9-
RUN wget -O puppet6.rpm http://yum.puppet.com/puppet6-release-el-8.noarch.rpm && \
10-
rpm -i puppet6.rpm --force --replacefiles --nodeps && \
11-
wget -O puppet7.rpm http://yum.puppet.com/puppet7-release-el-8.noarch.rpm && \
12-
rpm -i puppet7.rpm --force --replacefiles --nodeps
8+
# Install several repos: puppet 7 and 8
9+
RUN wget -O puppet7.rpm http://yum.puppet.com/puppet7-release-el-8.noarch.rpm && \
10+
rpm -i puppet7.rpm --force --replacefiles --nodeps && \
11+
wget -O puppet8.rpm http://yum.puppet.com/puppet8-release-el-8.noarch.rpm && \
12+
rpm -i puppet8.rpm --force --replacefiles --nodeps
1313

1414
# Print out available package versions for puppet-agent. If a specific version
1515
# is desired, pass that in with e.g. `--build-arg before=1.1.1`

0 commit comments

Comments
 (0)