Skip to content

Commit 8a6c224

Browse files
committed
Support Ubuntu 22.04
1 parent e27f584 commit 8a6c224

File tree

10 files changed

+47
-10
lines changed

10 files changed

+47
-10
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
with:
4040
ruby-version: ${{ matrix.ruby }}
4141
bundler-cache: true
42+
cache-version: 2
4243
bundler: '2.1.0'
4344
- name: Validate
4445
run: bundle exec rake check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint
@@ -54,6 +55,7 @@ jobs:
5455
- "el8"
5556
- "el9"
5657
- "ubuntu-2004"
58+
- "ubuntu-2204"
5759
puppet:
5860
- "puppet6"
5961
- "puppet7"
@@ -79,6 +81,7 @@ jobs:
7981
with:
8082
ruby-version: '2.7'
8183
bundler-cache: true
84+
cache-version: 2
8285
bundler: '2.1.0'
8386
- name: Run tests
8487
run: bundle exec rake beaker

.sync.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Rakefile:
1111
- el8
1212
- el9
1313
- ubuntu-2004
14+
- ubuntu-2204
1415
puppet:
1516
- puppet6
1617
- puppet7
@@ -29,3 +30,6 @@ spec/acceptance/nodesets/ubuntu-1804.yml:
2930
spec/acceptance/nodesets/ubuntu-2004.yml:
3031
packages:
3132
- cron
33+
spec/acceptance/nodesets/ubuntu-2204.yml:
34+
packages:
35+
- cron

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@
370370
$osname = $facts.dig('os', 'name')
371371
$osmajor = $facts.dig('os', 'release', 'major')
372372

373-
$supported = ['RedHat-7','RedHat-8','RedHat-9','Debian-20.04']
373+
$supported = ['RedHat-7','RedHat-8','RedHat-9','Debian-20.04','Debian-22.04']
374374
$os = "${osfamily}-${osmajor}"
375375
if ! ($os in $supported) {
376376
fail("Unsupported OS: module ${module_name}. osfamily=${osfamily} osmajor=${osmajor} detected")

metadata.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@
7777
{
7878
"operatingsystem": "Ubuntu",
7979
"operatingsystemrelease": [
80-
"20.04"
80+
"20.04",
81+
"22.04"
8182
]
8283
}
8384
],
@@ -94,5 +95,5 @@
9495
],
9596
"pdk-version": "2.1.0",
9697
"template-url": "https://github.com/treydock/pdk-templates.git#master",
97-
"template-ref": "heads/master-0-gc7a5ca2"
98+
"template-ref": "heads/master-0-gdddb343"
9899
}

spec/acceptance/nodesets/el7.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ HOSTS:
1010
- '/usr/sbin/init'
1111
docker_image_commands:
1212
- 'yum install -y wget which cronie iproute initscripts'
13+
- 'wget --no-check-certificate https://copr.fedorainfracloud.org/coprs/jsynacek/systemd-backports-for-centos-7/repo/epel-7/jsynacek-systemd-backports-for-centos-7-epel-7.repo -O /etc/yum.repos.d/jsynacek-systemd-centos-7.repo'
14+
- 'yum update -y systemd'
1315
docker_env:
1416
- LANG=en_US.UTF-8
1517
- LANGUAGE=en_US.UTF-8

spec/acceptance/nodesets/el8.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ HOSTS:
1111
docker_image_commands:
1212
- 'dnf install -y dnf-utils'
1313
- 'dnf config-manager --set-enabled powertools'
14-
- 'dnf install -y wget which cronie iproute initscripts langpacks-en glibc-all-langpacks cpio'
14+
- 'dnf install -y wget which cronie iproute initscripts langpacks-en glibc-all-langpacks glibc-langpack-en cpio'
1515
docker_env:
1616
- LANG=en_US.UTF-8
1717
- LANGUAGE=en_US.UTF-8

spec/acceptance/nodesets/el9.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ HOSTS:
1111
docker_image_commands:
1212
- 'dnf install -y dnf-utils'
1313
- 'dnf config-manager --set-enabled crb'
14-
- 'dnf install -y wget which cronie iproute initscripts langpacks-en glibc-all-langpacks cpio'
14+
- 'dnf install -y wget which cronie iproute initscripts langpacks-en glibc-all-langpacks glibc-langpack-en cpio'
1515
docker_env:
1616
- LANG=en_US.UTF-8
1717
- LANGUAGE=en_US.UTF-8
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
HOSTS:
2+
ubuntu2204:
3+
roles:
4+
- agent
5+
platform: ubuntu-22.04-amd64
6+
hypervisor : docker
7+
image: ubuntu:22.04
8+
docker_preserve_image: true
9+
docker_cmd: '["/sbin/init"]'
10+
docker_image_commands:
11+
- "rm -f /etc/dpkg/dpkg.cfg.d/excludes"
12+
- 'apt-get install -y wget net-tools iproute2 locales apt-transport-https ca-certificates cron'
13+
- 'locale-gen en_US.UTF-8'
14+
docker_env:
15+
- LANG=en_US.UTF-8
16+
- LANGUAGE=en_US.UTF-8
17+
- LC_ALL=en_US.UTF-8
18+
docker_container_name: 'openondemand-ubuntu2204'
19+
CONFIG:
20+
log_level: debug
21+
type: foss
22+
ssh:
23+
password: root
24+
auth_methods: ["password"]
25+

spec/spec_helper.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,24 @@
99

1010
require 'spec_helper_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_local.rb'))
1111

12-
include RspecPuppetFacts
12+
include RspecPuppetFacts # rubocop:disable Style/MixinUsage
1313

1414
default_facts = {
1515
puppetversion: Puppet.version,
16-
facterversion: Facter.version,
16+
facterversion: Facter.version
1717
}
1818

1919
default_fact_files = [
2020
File.expand_path(File.join(File.dirname(__FILE__), 'default_facts.yml')),
21-
File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml')),
21+
File.expand_path(File.join(File.dirname(__FILE__), 'default_module_facts.yml'))
2222
]
2323

2424
default_fact_files.each do |f|
2525
next unless File.exist?(f) && File.readable?(f) && File.size?(f)
2626

2727
begin
2828
default_facts.merge!(YAML.safe_load(File.read(f), [], [], true))
29-
rescue => e
29+
rescue StandardError => e
3030
RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}"
3131
end
3232
end

spec/spec_helper_acceptance.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
# frozen_string_literal: true
2+
13
require 'beaker-rspec'
24
require 'beaker-puppet'
35
require 'beaker/puppet_install_helper'
46
require 'beaker/module_install_helper'
57

6-
dir = File.expand_path(File.dirname(__FILE__))
8+
dir = __dir__
79
Dir["#{dir}/acceptance/shared_examples/**/*.rb"].sort.each { |f| require f }
810
require 'spec_helper_acceptance_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_acceptance_local.rb'))
911

0 commit comments

Comments
 (0)