Compare commits

...

6 commits

Author SHA1 Message Date
Patrik Lundin c82df547ee
Merge remote-tracking branch 'multiverse/main' 2024-11-13 13:31:39 +01:00
Patrik Lundin 57dcae2cdf
Merge pull request #57 from SUNET/patlu-no-ntp
Do not install ntp with cosmos script
2024-10-21 08:23:46 +02:00
Patrik Lundin f537508bee
Do not install ntp with cosmos script
This is handled with sunet::server
2024-10-17 16:36:45 +02:00
Patrik Holmqvist 028ba3d608
Merge pull request #56 from SUNET/pahol-fix-noble-eyaml
patch for broken eyaml in ubuntu24.04.
2024-09-10 13:16:19 +02:00
Patrik Holmqvist 7941e3f970
Merge the 2 patch functions to 1. 2024-09-09 17:29:31 +02:00
Patrik Holmqvist fac9a556ba
Patch for broken eyaml in ubuntu24.04. 2024-09-09 16:52:38 +02:00
2 changed files with 34 additions and 1 deletions

View file

@ -67,6 +67,39 @@ function patch_broken_eyaml {
next if @@plugins.include? spec
dependency = spec.dependencies.find { |d| d.name == "hiera-eyaml" }
EOF
fi
fi
fi
#
# Ubuntu 24.04 (noble) has a hiera-eyaml version that is incompatible with ruby 3.2+ (default in ubuntu24).
# This is fixed in hiera-eyaml version 3.3.0: https://github.com/voxpupuli/hiera-eyaml/pull/340/files
# https://github.com/voxpupuli/hiera-eyaml/blob/master/CHANGELOG.md
# But there is no modern version of hiera-eyaml packaged in debian or ubuntu.
# https://github.com/puppetlabs/puppet/wiki/Puppet-8-Compatibility#filedirexists-removed
#
. /etc/os-release
if [ "${VERSION_CODENAME}" == "noble" ]; then
plugins_file="/usr/share/rubygems-integration/all/gems/hiera-eyaml-3.3.0/lib/hiera/backend/eyaml/subcommands/edit.rb"
if [ -f $plugins_file ]; then
# We only want to try patching the file if it is the known broken version
bad_sum="59c6eb910ab2eb44f8c75aeaa79bff097038feb673b5c6bdccde23d9b2a393e2"
sum=$(sha256sum $plugins_file | awk '{print $1}')
if [ "$sum" == "$bad_sum" ]; then
patch --fuzz=0 --directory=/ --strip=0 <<'EOF'
--- /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.3.0/lib/hiera/backend/eyaml/subcommands/edit.rb.orig 2022-06-11 16:30:10.000000000 +0000
+++ /usr/share/rubygems-integration/all/gems/hiera-eyaml-3.3.0/lib/hiera/backend/eyaml/subcommands/edit.rb 2024-09-09 14:13:19.306342025 +0000
@@ -59,7 +59,7 @@
Optimist::die "You must specify an eyaml file" if ARGV.empty?
options[:source] = :eyaml
options[:eyaml] = ARGV.shift
- if File.exists? options[:eyaml]
+ if File.exist? options[:eyaml]
begin
options[:input_data] = File.read options[:eyaml]
rescue
EOF
fi
fi

View file

@ -8,7 +8,7 @@ set -e
stamp="$COSMOS_BASE/stamps/common-tools-v01.stamp"
if ! test -f $stamp; then
apt-get -y install vim traceroute tcpdump molly-guard less rsync git-core unattended-upgrades ntp
apt-get -y install vim traceroute tcpdump molly-guard less rsync git-core unattended-upgrades
update-alternatives --set editor /usr/bin/vim.basic
mkdir -p `dirname $stamp`