Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
2a984a3
update to ubuntu 20.04
rush-skills Jun 23, 2021
ff25573
add ubuntu20 to kitchen platforms
rush-skills Jun 23, 2021
a0d2c8f
add unstable testing channel for focal
rush-skills Jun 23, 2021
7a6a6d2
update github action build matrix
rush-skills Jun 23, 2021
0251f3b
use mongo 4.4 for st2 version > 3.4
rush-skills Jun 23, 2021
c8154eb
change mongo version 4.4 only for 3.5 not for 3.4
rush-skills Jun 23, 2021
b230228
update mongodb spec with 4.4 as latest version
rush-skills Jun 23, 2021
b0ad153
Add ubuntu18 unstable pipeline
rush-skills Jun 23, 2021
0195239
add centos7 unstable build and comment out u20 stable build
rush-skills Jun 23, 2021
17cd73b
change tests back to stable repo, remove unstable ci refs
rush-skills Jun 30, 2021
2975b18
install mongo 4.4 only on focal
rush-skills Jun 30, 2021
635e4d3
update nodejs version to v14 for st2 >= 3.5
rush-skills Jun 30, 2021
6fae9a3
edit vagrant file to add mongodb 4.4 repo apt key
rush-skills Jun 30, 2021
c7adcea
fix mongodb specs
rush-skills Jun 30, 2021
6f8de4a
fix mongodb fact check for u20
rush-skills Jun 30, 2021
5981f66
update mongo version and test for u20
rush-skills Jun 30, 2021
302a094
fix brackets
rush-skills Jun 30, 2021
a8ed130
try os conditional with if/end
rush-skills Jun 30, 2021
cb4adb2
try if-else for mongodb logic
rush-skills Sep 13, 2021
abb094c
fix typo
rush-skills Sep 14, 2021
d9a9b07
fix tests for u20
rush-skills Sep 14, 2021
9a5e70a
fix rubocop offenses
rush-skills Sep 14, 2021
c6c3cda
fix rubocop offense
rush-skills Sep 14, 2021
78d5052
cleanup old code
rush-skills Sep 14, 2021
03f6055
fix r10k version to 3.9 to prevent https://github.com/puppetlabs/r10k…
rush-skills Sep 14, 2021
69beb99
don't let rabbitmq manage python versions
rush-skills Sep 14, 2021
72c21c4
add software-properties-common in ubuntu images for apt-add-repo
rush-skills Sep 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ jobs:
- ruby: '2.7'
name: 'centos7-puppet7-python36'
- ruby: '2.7'
name: 'ubuntu16-puppet6'
name: 'ubuntu18-puppet6'
- ruby: '2.7'
name: 'ubuntu16-puppet7'
name: 'ubuntu18-puppet7'
- ruby: '2.7'
name: 'ubuntu16-puppet7-python36'
name: 'ubuntu18-puppet7-python36'
- ruby: '2.7'
name: 'ubuntu18-puppet6'
name: 'ubuntu20-puppet6'
- ruby: '2.7'
name: 'ubuntu18-puppet7'
name: 'ubuntu20-puppet7'
env:
CHECK: '${{ matrix.check }}'
steps:
Expand Down
40 changes: 20 additions & 20 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,61 +73,61 @@ platforms:
puppetfile_path: build/centos7-puppet7/Puppetfile
manifest: test/fullinstall_python36.pp

# Ubuntu Xenial with Systemd - Puppet 6
- name: ubuntu16-puppet6
# Ubuntu Bionic with Systemd - Puppet 6
- name: ubuntu18-puppet6
driver:
platform: ubuntu
dockerfile: build/ubuntu16-puppet6/Dockerfile.kitchen
dockerfile: build/ubuntu18-puppet6/Dockerfile.kitchen
run_command: /sbin/init
volume:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
puppetfile_path: build/ubuntu16-puppet6/Puppetfile
puppetfile_path: build/ubuntu18-puppet6/Puppetfile

# Ubuntu Xenial with Systemd - Puppet 7
- name: ubuntu16-puppet7
# Ubuntu Bionic with Systemd - Puppet 7
- name: ubuntu18-puppet7
driver:
platform: ubuntu
dockerfile: build/ubuntu16-puppet7/Dockerfile.kitchen
dockerfile: build/ubuntu18-puppet7/Dockerfile.kitchen
run_command: /sbin/init
volume:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
puppetfile_path: build/ubuntu16-puppet7/Puppetfile
puppetfile_path: build/ubuntu18-puppet7/Puppetfile

# Ubuntu Xenial with Systemd - Puppet 7 - Python 3.6
- name: ubuntu16-puppet7-python36
# Ubuntu Bionic with Systemd - Puppet 7 - Python 3.6
- name: ubuntu18-puppet7-python36
driver:
platform: ubuntu
dockerfile: build/ubuntu16-puppet7/Dockerfile.kitchen
dockerfile: build/ubuntu18-puppet7/Dockerfile.kitchen
run_command: /sbin/init
volume:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
puppetfile_path: build/ubuntu16-puppet7/Puppetfile
puppetfile_path: build/ubuntu18-puppet7/Puppetfile
manifest: test/fullinstall_python36.pp

# Ubuntu Bionic with Systemd - Puppet 6
- name: ubuntu18-puppet6
# Ubuntu Focal with Systemd - Puppet 6
- name: ubuntu20-puppet6
driver:
platform: ubuntu
dockerfile: build/ubuntu18-puppet6/Dockerfile.kitchen
dockerfile: build/ubuntu20-puppet6/Dockerfile.kitchen
run_command: /sbin/init
volume:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
puppetfile_path: build/ubuntu18-puppet6/Puppetfile
puppetfile_path: build/ubuntu20-puppet6/Puppetfile

# Ubuntu Bionic with Systemd - Puppet 7
- name: ubuntu18-puppet7
# Ubuntu Focal with Systemd - Puppet 7
- name: ubuntu20-puppet7
driver:
platform: ubuntu
dockerfile: build/ubuntu18-puppet7/Dockerfile.kitchen
dockerfile: build/ubuntu20-puppet7/Dockerfile.kitchen
run_command: /sbin/init
volume:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
provisioner:
puppetfile_path: build/ubuntu18-puppet7/Puppetfile
puppetfile_path: build/ubuntu20-puppet7/Puppetfile

suites:
- name: default
Expand Down
3 changes: 2 additions & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
# vagrant ssh
# sudo su -
# vi /etc/puppetlabs/code/modules/mongodb/manifests/repo.pp
# '4.4' => '20691EEC35216C63CAF66CE1656408E390CFB1F5',
# '4.2' => 'E162F504A20CDF15827F718D4B7C549A058F8B6B',
# '4.0' => '9DA31620334BD75D9DCB49F368818C72E52529D4',
#
Expand All @@ -64,8 +65,8 @@ provider = provider.to_sym
box = ENV['BOX'] ? ENV['BOX'] : 'centos/7'
#box = ENV['BOX'] ? ENV['BOX'] : 'centos/8stream'
#box = ENV['BOX'] ? ENV['BOX'] : 'generic/centos8'
#box = ENV['BOX'] ? ENV['BOX'] : 'generic/ubuntu1604'
#box = ENV['BOX'] ? ENV['BOX'] : 'generic/ubuntu1804'
#box = ENV['BOX'] ? ENV['BOX'] : 'generic/ubuntu2004'

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Expand Down
2 changes: 1 addition & 1 deletion build/kitchen/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ gem 'mixlib-shellout'
gem 'nokogiri'
gem 'public_suffix'
gem 'puppet'
gem 'r10k'
gem 'r10k', '~> 3.9.0'
gem 'semverse'
gem 'test-kitchen'
# hard code to 3.2.0 because sudo bugs: https://github.com/inspec/train/issues/548
Expand Down
2 changes: 1 addition & 1 deletion build/scripts/install_puppet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ sudo yum -y install git
# Install puppet module dependencies
sudo -i bash -c "pushd /vagrant/build/centos7-puppet6 && /opt/puppetlabs/puppet/bin/librarian-puppet install --verbose --path=/etc/puppetlabs/code/modules"

# Create symlink for the st2/ puppet module in the Pupept code directory.
# Create symlink for the st2/ puppet module in the Puppet code directory.
# This allows us to make changes locally, outside of the VM then automatically available
# within the VM so you can run `puppet agent -t` and it will just work!
#
Expand Down
3 changes: 3 additions & 0 deletions build/ubuntu18-puppet6/Dockerfile.kitchen
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ RUN echo '<%= IO.read(@public_key).strip %>' >> /home/<%= @username %>/.ssh/auth
# update OS
RUN sudo apt-get -y update

# Install utilities to add apt repos
RUN sudo apt-get -y install software-properties-common

# install puppet
# https://puppet.com/docs/puppet/6.0/puppet_platform.html
RUN wget https://apt.puppetlabs.com/puppet6-release-bionic.deb
Expand Down
3 changes: 3 additions & 0 deletions build/ubuntu18-puppet7/Dockerfile.kitchen
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ RUN echo '<%= IO.read(@public_key).strip %>' >> /home/<%= @username %>/.ssh/auth
# update OS
RUN sudo apt-get -y update

# Install utilities to add apt repos
RUN sudo apt-get -y install software-properties-common

# install puppet
# https://puppet.com/docs/puppet/7.0/puppet_platform.html
RUN wget https://apt.puppetlabs.com/puppet7-release-bionic.deb
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# usage (from the root of the puppet-st2/ directory):
# docker build -t stackstorm/puppet-st2-ubuntu16-puppet6 -f build/ubuntu16-puppet6/Dockerfile.kitchen .
# docker build -t stackstorm/puppet-st2-ubuntu20-puppet6 -f build/ubuntu20-puppet6/Dockerfile.kitchen .

FROM stackstorm/packagingtest:xenial-systemd
FROM stackstorm/packagingtest:focal-systemd

# kitchen setup
RUN mkdir -p /var/run/sshd
Expand All @@ -18,10 +18,13 @@ RUN echo '<%= IO.read(@public_key).strip %>' >> /home/<%= @username %>/.ssh/auth
# update OS
RUN sudo apt-get -y update

# Install utilities to add apt repos
RUN sudo apt-get -y install software-properties-common

# install puppet
# https://puppet.com/docs/puppet/6.0/puppet_platform.html
RUN wget https://apt.puppetlabs.com/puppet6-release-xenial.deb
RUN sudo dpkg -i puppet6-release-xenial.deb
RUN wget https://apt.puppetlabs.com/puppet6-release-focal.deb
RUN sudo dpkg -i puppet6-release-focal.deb
RUN sudo apt-get -y update
RUN sudo apt-get -y install puppet-agent

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# usage (from the root of the puppet-st2/ directory):
# docker build -t stackstorm/puppet-st2-ubuntu16-puppet7 -f build/ubuntu16-puppet7/Dockerfile.kitchen .
# docker build -t stackstorm/puppet-st2-ubuntu18-puppet7 -f build/ubuntu18-puppet7/Dockerfile.kitchen .

FROM stackstorm/packagingtest:xenial-systemd
FROM stackstorm/packagingtest:focal-systemd

# kitchen setup
RUN mkdir -p /var/run/sshd
Expand All @@ -18,10 +18,13 @@ RUN echo '<%= IO.read(@public_key).strip %>' >> /home/<%= @username %>/.ssh/auth
# update OS
RUN sudo apt-get -y update

# Install utilities to add apt repos
RUN sudo apt-get -y install software-properties-common

# install puppet
# https://puppet.com/docs/puppet/7.0/puppet_platform.html
RUN wget https://apt.puppetlabs.com/puppet7-release-xenial.deb
RUN sudo dpkg -i puppet7-release-xenial.deb
RUN wget https://apt.puppetlabs.com/puppet7-release-focal.deb
RUN sudo dpkg -i puppet7-release-focal.deb
RUN sudo apt-get -y update
RUN sudo apt-get -y install puppet-agent

Expand Down
File renamed without changes.
6 changes: 5 additions & 1 deletion manifests/profile/mongodb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@
$manage_repo = $st2::mongodb_manage_repo,
$auth = $st2::mongodb_auth,
) inherits st2 {
# if Ubuntu is 20.04 then MongoDB 4.4
# if the StackStorm version is > 3.3.0 then MongoDB 4.0
# if the StackStorm version is > 2.4.0 then MongoDB 3.4
# else use MongoDB 3.2
if st2::version_ge('3.3.0') {
if $facts['os']['family'] == 'Debian' and $facts['os']['release']['major'] == '20.04' and st2::version_ge('3.3.0') {
$_mongodb_version_default = '4.4'
}
elsif st2::version_ge('3.3.0') {
$_mongodb_version_default = '4.0'
}
elsif st2::version_ge('2.4.0') {
Expand Down
8 changes: 7 additions & 1 deletion manifests/profile/nodejs.pp
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@
$version = $::st2::nodejs_version,
) inherits st2 {

$use_rhel7_builtin = false

# if the StackStorm version is >= 3.5.0 then use NodeJS 14.x
# if the StackStorm version is >= 2.10.0 then use NodeJS 10.x
# if the StackStorm version is 2.10.0 < and >= 2.4.0 then use NodeJS 6.x
# else use NodeJS 4.x
if st2::version_ge('2.10.0') {
if st2::version_ge('3.5.0') {
$nodejs_version_default = '14.x'
}
elsif st2::version_ge('2.10.0') {
$nodejs_version_default = '10.x'
}
elsif st2::version_ge('2.4.0') {
Expand Down
1 change: 1 addition & 0 deletions manifests/profile/rabbitmq.pp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
environment_variables => {
'RABBITMQ_NODE_IP_ADDRESS' => $::st2::rabbitmq_bind_ip,
},
manage_python => false,
}
contain 'rabbitmq'

Expand Down
5 changes: 5 additions & 0 deletions manifests/test/fullinstall_unstable.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

class { 'st2':
repository => 'unstable',
}
include st2::profile::fullinstall
4 changes: 2 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"16.04",
"18.04"
"18.04",
"20.04"
]
}
],
Expand Down
27 changes: 20 additions & 7 deletions spec/classes/profile/mongodb_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
require 'spec_helper'

describe 'st2::profile::mongodb' do
let(:latest_version) { '4.0' }

on_supported_os.each do |os, os_facts|
let(:facts) { os_facts }

if os == 'ubuntu-20.04-x86_64'
let(:latest_version) { '4.4' }

else
let(:latest_version) { '4.0' }

end
context "on #{os}" do
context 'with default options' do
it { is_expected.to compile.with_all_deps }
Expand Down Expand Up @@ -39,11 +44,19 @@
let(:facts) { os_facts.merge('st2_version' => '3.3.0') }

it do
is_expected.to contain_class('mongodb::globals')
.with('manage_package' => true,
'manage_package_repo' => true,
'version' => '4.0',
'manage_pidfile' => false)
if os == 'ubuntu-20.04-x86_64'
is_expected.to contain_class('mongodb::globals')
.with('manage_package' => true,
'manage_package_repo' => true,
'version' => '4.4',
'manage_pidfile' => false)
else
is_expected.to contain_class('mongodb::globals')
.with('manage_package' => true,
'manage_package_repo' => true,
'version' => '4.0',
'manage_pidfile' => false)
end
end
end

Expand Down
4 changes: 2 additions & 2 deletions test/integration/stackstorm/inspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ version: 0.1.0
supports:
- os-name: centos
release: 7.*
- os-name: ubuntu
release: 16.04
- os-name: ubuntu
release: 18.04
- os-name: ubuntu
release: 20.04