Skip to content

Commit 89eebed

Browse files
authored
Merge branch 'main' into appcds
2 parents 21242a6 + f33847b commit 89eebed

7 files changed

Lines changed: 146 additions & 7 deletions

File tree

Containerfile.alpine

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,38 @@ ARG OPENVOXDB_VERSION=8.14.1
1818
ADD https://artifacts.voxpupuli.org/openvox-server/${OPENVOXSERVER_VERSION}/openvox-server-${OPENVOXSERVER_VERSION}.tar.gz /
1919
ADD https://artifacts.voxpupuli.org/openvoxdb/${OPENVOXDB_VERSION}/openvoxdb-${OPENVOXDB_VERSION}.tar.gz /
2020

21+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-augeas_core
22+
ARG MODULE_AUGEAS_CORE=1.5.0
23+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-cron_core
24+
ARG MODULE_CRON_CORE=1.3.0
25+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-host_core
26+
ARG MODULE_HOST_CORE=1.3.0
27+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-mount_core
28+
ARG MODULE_MOUNT_CORE=1.3.0
29+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-scheduled_task
30+
ARG MODULE_SCHEDULED_TASK=3.2.0
31+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-selinux_core
32+
ARG MODULE_SELINUX_CORE=1.4.0
33+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-sshkeys_core
34+
ARG MODULE_SSHKEYS_CORE=2.5.0
35+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-yumrepo_core
36+
ARG MODULE_YUMREPO_CORE=2.1.0
37+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-zfs_core
38+
ARG MODULE_ZFS_CORE=1.6.1
39+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-zone_core
40+
ARG MODULE_ZONE_CORE=1.2.0
41+
42+
ADD https://github.com/OpenVoxProject/puppetlabs-augeas_core/archive/refs/tags/v${MODULE_AUGEAS_CORE}.tar.gz /vendor_modules/puppetlabs-augeas_core.tar.gz
43+
ADD https://github.com/OpenVoxProject/puppetlabs-cron_core/archive/refs/tags/v${MODULE_CRON_CORE}.tar.gz /vendor_modules/puppetlabs-cron_core.tar.gz
44+
ADD https://github.com/OpenVoxProject/puppetlabs-host_core/archive/refs/tags/v${MODULE_HOST_CORE}.tar.gz /vendor_modules/puppetlabs-host_core.tar.gz
45+
ADD https://github.com/OpenVoxProject/puppetlabs-mount_core/archive/refs/tags/v${MODULE_MOUNT_CORE}.tar.gz /vendor_modules/puppetlabs-mount_core.tar.gz
46+
ADD https://github.com/OpenVoxProject/puppetlabs-scheduled_task/archive/refs/tags/v${MODULE_SCHEDULED_TASK}.tar.gz /vendor_modules/puppetlabs-scheduled_task.tar.gz
47+
ADD https://github.com/OpenVoxProject/puppetlabs-selinux_core/archive/refs/tags/v${MODULE_SELINUX_CORE}.tar.gz /vendor_modules/puppetlabs-selinux_core.tar.gz
48+
ADD https://github.com/OpenVoxProject/puppetlabs-sshkeys_core/archive/refs/tags/v${MODULE_SSHKEYS_CORE}.tar.gz /vendor_modules/puppetlabs-sshkeys_core.tar.gz
49+
ADD https://github.com/OpenVoxProject/puppetlabs-yumrepo_core/archive/refs/tags/v${MODULE_YUMREPO_CORE}.tar.gz /vendor_modules/puppetlabs-yumrepo_core.tar.gz
50+
ADD https://github.com/OpenVoxProject/puppetlabs-zfs_core/archive/refs/tags/v${MODULE_ZFS_CORE}.tar.gz /vendor_modules/puppetlabs-zfs_core.tar.gz
51+
ADD https://github.com/OpenVoxProject/puppetlabs-zone_core/archive/refs/tags/v${MODULE_ZONE_CORE}.tar.gz /vendor_modules/puppetlabs-zone_core.tar.gz
52+
2153
COPY openvoxserver/prep_build_container.sh /
2254
RUN /prep_build_container.sh
2355

@@ -35,8 +67,8 @@ ARG RUBYGEM_R10K=5.0.3
3567
# renovate: datasource=rubygems depName=rugged
3668
ARG RUBYGEM_RUGGED=1.9.0
3769

38-
ARG OPENVOX_USER_UID=1001
39-
ARG OPENVOX_USER_GID=1001
70+
ARG OPENVOX_USER_UID=64604
71+
ARG OPENVOX_USER_GID=64604
4072

4173
# renovate: datasource=custom.voxpupuli-artifacts depName=openvox-server
4274
ARG OPENVOXSERVER_VERSION=8.14.1

Containerfile.ubuntu

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,38 @@ ARG OPENVOXDB_VERSION=8.14.1
2727
ADD https://artifacts.voxpupuli.org/openvox-server/${OPENVOXSERVER_VERSION}/openvox-server-${OPENVOXSERVER_VERSION}.tar.gz /
2828
ADD https://artifacts.voxpupuli.org/openvoxdb/${OPENVOXDB_VERSION}/openvoxdb-${OPENVOXDB_VERSION}.tar.gz /
2929

30+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-augeas_core
31+
ARG MODULE_AUGEAS_CORE=1.5.0
32+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-cron_core
33+
ARG MODULE_CRON_CORE=1.3.0
34+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-host_core
35+
ARG MODULE_HOST_CORE=1.3.0
36+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-mount_core
37+
ARG MODULE_MOUNT_CORE=1.3.0
38+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-scheduled_task
39+
ARG MODULE_SCHEDULED_TASK=3.2.0
40+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-selinux_core
41+
ARG MODULE_SELINUX_CORE=1.4.0
42+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-sshkeys_core
43+
ARG MODULE_SSHKEYS_CORE=2.5.0
44+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-yumrepo_core
45+
ARG MODULE_YUMREPO_CORE=2.1.0
46+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-zfs_core
47+
ARG MODULE_ZFS_CORE=1.6.1
48+
# renovate: datasource=github-tags depName=OpenVoxProject/puppetlabs-zone_core
49+
ARG MODULE_ZONE_CORE=1.2.0
50+
51+
ADD https://github.com/OpenVoxProject/puppetlabs-augeas_core/archive/refs/tags/v${MODULE_AUGEAS_CORE}.tar.gz /vendor_modules/puppetlabs-augeas_core.tar.gz
52+
ADD https://github.com/OpenVoxProject/puppetlabs-cron_core/archive/refs/tags/v${MODULE_CRON_CORE}.tar.gz /vendor_modules/puppetlabs-cron_core.tar.gz
53+
ADD https://github.com/OpenVoxProject/puppetlabs-host_core/archive/refs/tags/v${MODULE_HOST_CORE}.tar.gz /vendor_modules/puppetlabs-host_core.tar.gz
54+
ADD https://github.com/OpenVoxProject/puppetlabs-mount_core/archive/refs/tags/v${MODULE_MOUNT_CORE}.tar.gz /vendor_modules/puppetlabs-mount_core.tar.gz
55+
ADD https://github.com/OpenVoxProject/puppetlabs-scheduled_task/archive/refs/tags/v${MODULE_SCHEDULED_TASK}.tar.gz /vendor_modules/puppetlabs-scheduled_task.tar.gz
56+
ADD https://github.com/OpenVoxProject/puppetlabs-selinux_core/archive/refs/tags/v${MODULE_SELINUX_CORE}.tar.gz /vendor_modules/puppetlabs-selinux_core.tar.gz
57+
ADD https://github.com/OpenVoxProject/puppetlabs-sshkeys_core/archive/refs/tags/v${MODULE_SSHKEYS_CORE}.tar.gz /vendor_modules/puppetlabs-sshkeys_core.tar.gz
58+
ADD https://github.com/OpenVoxProject/puppetlabs-yumrepo_core/archive/refs/tags/v${MODULE_YUMREPO_CORE}.tar.gz /vendor_modules/puppetlabs-yumrepo_core.tar.gz
59+
ADD https://github.com/OpenVoxProject/puppetlabs-zfs_core/archive/refs/tags/v${MODULE_ZFS_CORE}.tar.gz /vendor_modules/puppetlabs-zfs_core.tar.gz
60+
ADD https://github.com/OpenVoxProject/puppetlabs-zone_core/archive/refs/tags/v${MODULE_ZONE_CORE}.tar.gz /vendor_modules/puppetlabs-zone_core.tar.gz
61+
3062
COPY openvoxserver/prep_build_container.sh /
3163
RUN /prep_build_container.sh
3264

@@ -44,8 +76,8 @@ ARG RUBYGEM_R10K=5.0.3
4476
# renovate: datasource=rubygems depName=rugged
4577
ARG RUBYGEM_RUGGED=1.9.0
4678

47-
ARG OPENVOX_USER_UID=1001
48-
ARG OPENVOX_USER_GID=1001
79+
ARG OPENVOX_USER_UID=64604
80+
ARG OPENVOX_USER_GID=64604
4981

5082
# renovate: datasource=custom.voxpupuli-artifacts depName=openvox-server
5183
ARG OPENVOXSERVER_VERSION=8.14.1

MIGRATION.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Migrations
2+
3+
## V8.12.0 -> V8.13.0
4+
5+
UID is changed from 1001 on alpine and 999 on ubuntu to 64604.
6+
If you already deployed the containers with mounted volume, you NEED to change the ownershop of these volumes and the files underneath.
7+
8+
```bash
9+
chown -R 64604:64604 [PATH TO THE VOLUME]
10+
```

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- [OpenVox Server container](#openvox-server-container)
1010
- [Informations](#informations)
1111
- [End of Life for OpenVox Server 7](#end-of-life-for-openvox-server-7)
12+
- [Migration](#migration)
1213
- [Note about environment caching](#note-about-environment-caching)
1314
- [Version schema](#version-schema)
1415
- [Configuration](#configuration)
@@ -55,6 +56,10 @@ For compose file see: [CRAFTY](https://github.com/voxpupuli/crafty/tree/main/ope
5556
Consequently, no new OpenVox Server 7 releases will be build.
5657
Existing versions will be retained for continued access.
5758

59+
### Migration
60+
61+
Before updating to a newer version of your container, you should check the [migration document](MIGRATION.md)
62+
5863
## Note about environment caching
5964

6065
⚠️ The OpenVox Server has [the environment caching](https://www.puppet.com/docs/puppet/8/server/admin-api/v1/environment-cache.html) enabled by default.

openvoxserver/prep_build_container.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,10 @@ cd /puppetdb-${OPENVOXDB_VERSION}
6262
RUBY_LIB_DIR="/opt/puppetlabs/puppet/lib/ruby/vendor_ruby"
6363
install -d "$RUBY_LIB_DIR"
6464
cp -r puppet "$RUBY_LIB_DIR/"
65+
66+
mkdir -p /opt/puppetlabs/puppet/vendor_modules
67+
cd /vendor_modules
68+
for module in augeas_core cron_core host_core mount_core scheduled_task selinux_core sshkeys_core yumrepo_core zfs_core zone_core; do
69+
mkdir /opt/puppetlabs/puppet/vendor_modules/$module
70+
tar -xzf puppetlabs-$module.tar.gz -C /opt/puppetlabs/puppet/vendor_modules/$module --strip-components 1
71+
done

openvoxserver/prep_release_container.sh

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,18 @@ else
4747
exit 1
4848
fi
4949

50-
gem install --no-document hiera-eyaml:${RUBYGEM_HIERA_EYAML}
50+
# Install gems into the system CRuby gem path. These back the tools that run
51+
# under the distro Ruby inside the container: the `puppet`/`facter` CLIs (used
52+
# by the entrypoint, e.g. `puppet config print`), the `puppetserver ca` CLI
53+
# (its cli/apps/ca app runs under the distro Ruby via /opt/puppetlabs/puppet/bin/ruby
54+
# and needs openvoxserver-ca plus its hocon dependency), and the `r10k`
55+
# convenience symlink created below. racc and syslog are stdlib gems dropped
56+
# from default Ruby 3.4+, installed here for the distro Ruby. rugged is a native
57+
# extension that cannot load on JRuby.
58+
#
59+
# NOTE: this path is NOT on puppetserver's JRuby gem-path. hiera-eyaml is needed
60+
# only by the server JVM (for eyaml Hiera lookups), so it is installed solely
61+
# into the JRuby gem-home further down, along with openvox. See #148.
5162
gem install --no-document hocon:1.4.0
5263
gem install --no-document openvox:${RUBYGEM_OPENVOX}
5364
gem install --no-document openvoxserver-ca:${RUBYGEM_OPENVOXSERVER_CA}
@@ -97,13 +108,44 @@ chmod 0770 /opt/puppetlabs/server/data/puppetserver
97108
find /etc/puppetlabs/puppet/ssl -type d -exec chmod 0770 {} \;
98109

99110
mkdir -p /opt/puppetlabs/puppet/bin
100-
for executable in puppet facter ruby gem irb erb r10k eyaml
111+
for executable in puppet facter ruby gem irb erb r10k
101112
do
102113
ln -s "$(command -v "$executable")" "/opt/puppetlabs/puppet/bin/$executable"
103114
done
104115

105-
# install puppet gem as library into jruby loadpath
116+
# Install the gems the puppetserver JVM loads at runtime into the JRuby
117+
# gem-home. The `gem install` calls above only populate the distro CRuby gem
118+
# path (e.g. /var/lib/gems/3.x), which is NOT on puppetserver's JRuby gem-path,
119+
# so any gem the server loads is invisible there. openvox provides puppet as a
120+
# server library, and hiera-eyaml is required for eyaml-encrypted Hiera lookups
121+
# during catalog compilation. The other gems above are CLI tools that run under
122+
# the distro Ruby (not the JVM), so they are not needed here. See #148.
106123
puppetserver gem install --no-document openvox:${RUBYGEM_OPENVOX}
124+
puppetserver gem install --no-document hiera-eyaml:${RUBYGEM_HIERA_EYAML}
125+
126+
# Colocate the puppetdb termini with the openvox gem lib so the puppetdb_query
127+
# function resolves during compilation. The termini in vendor_ruby (on
128+
# ruby-load-path) cover the require-loaded terminus and report processor, but
129+
# Puppet 4 functions load via the Pops system loader, rooted at puppet's own lib
130+
# rather than ruby-load-path. Since #141 gem-installs openvox instead of using
131+
# the OS packages (whose openvoxdb-termini colocated everything in vendor_ruby),
132+
# that root is the gem lib, so puppetdb_query would otherwise be unknown.
133+
cp -r /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet \
134+
"/opt/puppetlabs/server/data/puppetserver/jruby-gems/gems/openvox-${RUBYGEM_OPENVOX}/lib/"
135+
136+
# Expose the `eyaml` CLI. hiera-eyaml lives only in the JRuby gem-home, and its
137+
# binstub there resolves the gem against the default (distro) gem-path, where it
138+
# is no longer installed, so it can't simply be symlinked. Wrap it to run under
139+
# the distro Ruby with GEM_PATH pointed at the JRuby gem-home; hiera-eyaml is a
140+
# pure-Ruby gem, so it loads fine there and we avoid JVM start-up. The CLI is
141+
# essentially never used inside the container, it is provided only for the
142+
# occasional manual eyaml encrypt/decrypt.
143+
cat > /opt/puppetlabs/puppet/bin/eyaml <<'SCRIPT'
144+
#!/bin/bash
145+
export GEM_PATH="/opt/puppetlabs/server/data/puppetserver/jruby-gems${GEM_PATH:+:$GEM_PATH}"
146+
exec ruby /opt/puppetlabs/server/data/puppetserver/jruby-gems/bin/eyaml "$@"
147+
SCRIPT
148+
chmod 0755 /opt/puppetlabs/puppet/bin/eyaml
107149

108150
# use system/root paths instead of non-root paths to make permission management
109151
# and volume mounting simpler. for this we link the appropiate paths and explicitly

renovate.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@
1717
"#\\s*renovate:\\s*depName=(?<depName>[a-z0-9_-]+)\\s+datasource=rubygems\\s*\\n\\s*ARG\\s+RUBYGEM_[A-Z0-9_]+=(?<currentValue>\\d+\\.\\d+\\.\\d+)"
1818
]
1919
},
20+
{
21+
"customType": "regex",
22+
"datasourceTemplate": "github-tags",
23+
"extractVersionTemplate": "^v(?<version>\\d+\\.\\d+\\.\\d+)$",
24+
"managerFilePatterns": [
25+
"/(^|/)Containerfile\\.(?:alpine|ubuntu)$/"
26+
],
27+
"matchStrings": [
28+
"#\\s*renovate:\\s*datasource=github-tags\\s+depName=(?<depName>OpenVoxProject/puppetlabs-[a-z0-9_]+)\\s*\\n\\s*ARG\\s+MODULE_[A-Z0-9_]+=(?<currentValue>\\d+\\.\\d+\\.\\d+)"
29+
]
30+
},
2031
{
2132
"customType": "regex",
2233
"managerFilePatterns": [

0 commit comments

Comments
 (0)