Skip to content

Commit a1839e6

Browse files
Fix Puppet CI (#784)
* Pin semantic-puppet version in kitchen tests * Create Gemfile and use bundle to isntall r10k * Add puppet 7.14 and 7.9 tests back
1 parent 57ffbd1 commit a1839e6

5 files changed

Lines changed: 32 additions & 10 deletions

File tree

.circleci/config.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ jobs:
240240
STRICT_VARIABLES: 'yes'
241241
RUBY_VERSION: '2.6.3'
242242
PUPPET_VERSION: '6.5.0'
243-
244243
specs-ruby26-puppet79:
245244
<<: *specs
246245
environment:
@@ -255,6 +254,13 @@ jobs:
255254
RUBY_VERSION: '2.6.3'
256255
PUPPET_VERSION: '7.14.0'
257256

257+
specs-ruby26-puppet725:
258+
<<: *specs
259+
environment:
260+
STRICT_VARIABLES: 'yes'
261+
RUBY_VERSION: '2.6.3'
262+
PUPPET_VERSION: '7.25.0'
263+
258264
specs-ruby25-puppet65-windows: &windows-specs
259265
executor:
260266
name: win/default # Comes with ruby 2.6, which is not supported on Windows as of puppet 6.10.1
@@ -366,5 +372,6 @@ workflows:
366372
- specs-ruby26-puppet65
367373
- specs-ruby26-puppet79
368374
- specs-ruby26-puppet714
375+
- specs-ruby26-puppet725
369376
- verify-gemfile-lock-dependencies
370377
- kitchen-tests

.fixtures.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ fixtures:
1414
ref: "1.0.0"
1515
ruby: "git://github.com/puppetlabs/puppetlabs-ruby.git"
1616
forge_modules:
17-
yumrepo_core: "puppetlabs/yumrepo_core"
18-
powershell: "puppetlabs/powershell"
17+
yumrepo_core:
18+
repo: "puppetlabs/yumrepo_core"
19+
ref: "1.2.0"
20+
powershell:
21+
repo: "puppetlabs/powershell"
22+
ref: "4.1.0"
1923
zypprepo:
2024
repo: "puppet/zypprepo"
2125
ref: "3.1.0"

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@ ruby_version = Gem::Version.new(RUBY_VERSION.dup)
55
# Each version of Puppet recommends a specific version of Ruby. Try to fetch the Puppet version that
66
# matches our Ruby (unless PUPPET_VERSION is defined).
77
matching_puppet_version = ruby_version > Gem::Version.new('2.5') ? (ruby_version > Gem::Version.new('2.7') ? '7.0.0' : '6.0.1') : '4.10.2'
8-
gem "puppet", "~> #{ENV.fetch('PUPPET_VERSION', matching_puppet_version)}"
8+
puppet_version = ENV.fetch('PUPPET_VERSION', matching_puppet_version)
9+
gem "puppet", "~> #{puppet_version}"
910

1011
ruby_version_segments = ruby_version.segments
1112
minor_version = ruby_version_segments[0..1].join('.')
1213

1314
group :development do
1415
gem "rake", "~> 12.3.3" if ruby_version < Gem::Version.new('2.6.0') # last version for ruby < 2.6
1516
gem "xmlrpc" if ruby_version >= Gem::Version.new('2.3')
17+
gem "concurrent-ruby", '= 1.1.10' if Gem::Requirement.create([' >= 6.9.0', '<7.25.0']).satisfied_by?(Gem::Version.new(puppet_version)) # Add this beucause until Puppet 7.25 concurrent-ruby 1.22 break puppet
1618
gem "ruby-pwsh", '~> 0.3.0', platforms: [:mswin, :mingw, :x64_mingw]
1719
gem "fast_gettext", '1.1.0', require: false if ruby_version < Gem::Version.new('2.1.0')
1820
gem "fast_gettext", require: false if ruby_version >= Gem::Version.new('2.1.0')

environments/etc/Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source 'https://rubygems.org'
2+
gem 'semantic_puppet', '1.0.4'
3+
gem 'multipart-post', '2.1.1'
4+
gem 'r10k', '2.6.7'

kitchen.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ platforms:
2727

2828
- mkdir /home/kitchen/puppet
2929
- printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile
30+
- printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile
3031

3132
- gem install bundler -v '= 1.17.3'
32-
# multipart-post 2.2.0 breaks r10k 2.6.7, so lock it at 2.1.1 (we can't upgrade r10k because of old Ruby)
33-
- gem install multipart-post:2.1.1 r10k:2.6.7
33+
# we use bundle to install gems and to lock dependencies versions of semantic_puppet and multipart-post
34+
- cd /home && bundle install
3435
- cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules
3536

3637
- name: rocky-8-puppet-5
@@ -47,9 +48,11 @@ platforms:
4748

4849
- mkdir /home/kitchen/puppet
4950
- printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile
51+
- printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile
5052

5153
- gem install bundler -v '= 1.17.3'
52-
- gem install multipart-post:2.1.1 r10k:2.6.7
54+
55+
- cd /home && bundle install
5356
- cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules
5457

5558
- name: ubuntu-1604-puppet-6
@@ -67,9 +70,10 @@ platforms:
6770

6871
- mkdir /home/kitchen/puppet
6972
- printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile
73+
- printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile
7074

7175
- gem install bundler -v '= 1.17.3'
72-
- gem install multipart-post:2.1.1 r10k:2.6.7
76+
- cd /home && bundle install
7377
- cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules
7478

7579
- name: opensuse/leap-15
@@ -93,9 +97,10 @@ platforms:
9397
- ln -s /opt/puppetlabs/puppet/bin/puppet /usr/bin/puppet
9498
- mkdir /home/kitchen/puppet
9599
- printf <%= File.read('environments/etc/Puppetfile').inspect %> > /home/kitchen/puppet/Puppetfile
100+
- printf <%= File.read('environments/etc/Gemfile').inspect %> > /home/Gemfile
96101

97-
- /opt/puppetlabs/puppet/bin/gem install multipart-post:2.1.1 r10k:2.6.7
98-
- cd /home/kitchen/puppet && /opt/puppetlabs/puppet/bin/r10k puppetfile install --moduledir=/tmp/modules
102+
- cd /home && bundle.ruby2.5 install
103+
- cd /home/kitchen/puppet && r10k puppetfile install --moduledir=/tmp/modules
99104

100105
verifier:
101106
name: serverspec

0 commit comments

Comments
 (0)