diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index cfed22d4..450209db 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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: diff --git a/.kitchen.yml b/.kitchen.yml index dcde9539..5efbf95a 100644 --- a/.kitchen.yml +++ b/.kitchen.yml @@ -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 diff --git a/Vagrantfile b/Vagrantfile index 2ec2a855..fb42585f 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -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', # @@ -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" diff --git a/build/kitchen/Gemfile b/build/kitchen/Gemfile index 3bb16114..12b78c4b 100644 --- a/build/kitchen/Gemfile +++ b/build/kitchen/Gemfile @@ -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 diff --git a/build/scripts/install_puppet.sh b/build/scripts/install_puppet.sh index e3c4a8cc..53603f74 100755 --- a/build/scripts/install_puppet.sh +++ b/build/scripts/install_puppet.sh @@ -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! # diff --git a/build/ubuntu18-puppet6/Dockerfile.kitchen b/build/ubuntu18-puppet6/Dockerfile.kitchen index 967f0074..2d30e34c 100644 --- a/build/ubuntu18-puppet6/Dockerfile.kitchen +++ b/build/ubuntu18-puppet6/Dockerfile.kitchen @@ -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 diff --git a/build/ubuntu18-puppet7/Dockerfile.kitchen b/build/ubuntu18-puppet7/Dockerfile.kitchen index a21d7a71..19d914e7 100644 --- a/build/ubuntu18-puppet7/Dockerfile.kitchen +++ b/build/ubuntu18-puppet7/Dockerfile.kitchen @@ -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 diff --git a/build/ubuntu16-puppet6/Dockerfile.kitchen b/build/ubuntu20-puppet6/Dockerfile.kitchen similarity index 77% rename from build/ubuntu16-puppet6/Dockerfile.kitchen rename to build/ubuntu20-puppet6/Dockerfile.kitchen index 18e3065d..d6f17795 100644 --- a/build/ubuntu16-puppet6/Dockerfile.kitchen +++ b/build/ubuntu20-puppet6/Dockerfile.kitchen @@ -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 @@ -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 diff --git a/build/ubuntu16-puppet6/Puppetfile b/build/ubuntu20-puppet6/Puppetfile similarity index 100% rename from build/ubuntu16-puppet6/Puppetfile rename to build/ubuntu20-puppet6/Puppetfile diff --git a/build/ubuntu16-puppet7/Dockerfile.kitchen b/build/ubuntu20-puppet7/Dockerfile.kitchen similarity index 77% rename from build/ubuntu16-puppet7/Dockerfile.kitchen rename to build/ubuntu20-puppet7/Dockerfile.kitchen index 3029d000..85e66231 100644 --- a/build/ubuntu16-puppet7/Dockerfile.kitchen +++ b/build/ubuntu20-puppet7/Dockerfile.kitchen @@ -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 @@ -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 diff --git a/build/ubuntu16-puppet7/Puppetfile b/build/ubuntu20-puppet7/Puppetfile similarity index 100% rename from build/ubuntu16-puppet7/Puppetfile rename to build/ubuntu20-puppet7/Puppetfile diff --git a/manifests/profile/mongodb.pp b/manifests/profile/mongodb.pp index 52d2b981..5c4dc51b 100644 --- a/manifests/profile/mongodb.pp +++ b/manifests/profile/mongodb.pp @@ -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') { diff --git a/manifests/profile/nodejs.pp b/manifests/profile/nodejs.pp index 923c3938..f0af91de 100644 --- a/manifests/profile/nodejs.pp +++ b/manifests/profile/nodejs.pp @@ -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') { diff --git a/manifests/profile/rabbitmq.pp b/manifests/profile/rabbitmq.pp index 3cb2f6a1..3e312184 100644 --- a/manifests/profile/rabbitmq.pp +++ b/manifests/profile/rabbitmq.pp @@ -61,6 +61,7 @@ environment_variables => { 'RABBITMQ_NODE_IP_ADDRESS' => $::st2::rabbitmq_bind_ip, }, + manage_python => false, } contain 'rabbitmq' diff --git a/manifests/test/fullinstall_unstable.pp b/manifests/test/fullinstall_unstable.pp new file mode 100644 index 00000000..9a794f41 --- /dev/null +++ b/manifests/test/fullinstall_unstable.pp @@ -0,0 +1,5 @@ + +class { 'st2': + repository => 'unstable', +} +include st2::profile::fullinstall diff --git a/metadata.json b/metadata.json index 70ad4f1e..b7621673 100644 --- a/metadata.json +++ b/metadata.json @@ -88,8 +88,8 @@ { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ - "16.04", - "18.04" + "18.04", + "20.04" ] } ], diff --git a/spec/classes/profile/mongodb_spec.rb b/spec/classes/profile/mongodb_spec.rb index 1715ac8f..cf75da82 100644 --- a/spec/classes/profile/mongodb_spec.rb +++ b/spec/classes/profile/mongodb_spec.rb @@ -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 } @@ -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 diff --git a/test/integration/stackstorm/inspec.yml b/test/integration/stackstorm/inspec.yml index 45504851..aadb1f8c 100644 --- a/test/integration/stackstorm/inspec.yml +++ b/test/integration/stackstorm/inspec.yml @@ -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