diff --git a/Puppetfile_unit b/Puppetfile_unit index 4c123cd46..72b0dd842 100644 --- a/Puppetfile_unit +++ b/Puppetfile_unit @@ -18,3 +18,8 @@ mod 'yumrepo_core', mod 'mount_core', :git => 'https://github.com/puppetlabs/puppetlabs-mount_core', :ref => '1.0.4' + +# NOTE(tobias-urdin): Needed by p-o-i. +mod 'selinux_core', + :git => 'https://github.com/puppetlabs/puppetlabs-selinux_core', + :ref => '1.0.4' diff --git a/manifests/repos.pp b/manifests/repos.pp index d54294750..583b8500f 100644 --- a/manifests/repos.pp +++ b/manifests/repos.pp @@ -1,10 +1,10 @@ class openstack_integration::repos { - # To make beaker tests work. - if $::ceph_version != '' { + # To make litmus tests work. + if defined('$::ceph_version') and $::ceph_version != '' { $ceph_version_real = $::ceph_version } else { - $ceph_version_real = 'mimic' + $ceph_version_real = 'nautilus' } case $::osfamily { 'Debian': { @@ -30,7 +30,7 @@ class openstack_integration::repos { } # Ceph is both packaged on UCA and official download.ceph.com packages # which we mirror. We want to use the official packages or our mirror. - if $::nodepool_mirror_host != '' { + if defined('$::nodepool_mirror_host') and $::nodepool_mirror_host != '' { $ceph_version_cap = capitalize($ceph_version_real) apt::pin { 'ceph': priority => 1001, @@ -47,10 +47,15 @@ class openstack_integration::repos { $ceph_mirror = pick($::ceph_mirror_host, "http://download.ceph.com/debian-${ceph_version_real}/") } 'RedHat': { + if defined('$::centos_mirror_host') and $::centos_mirror_host != '' { + $centos_mirror = $::centos_mirror_host + } else { + $centos_mirror = 'http://mirror.centos.org' + } class { 'openstack_extras::repo::redhat::redhat': manage_rdo => false, manage_epel => false, - centos_mirror_url => $::centos_mirror_host, + centos_mirror_url => $centos_mirror, repo_source_hash => { 'delorean.repo' => "https://trunk.rdoproject.org/centos${::os['release']['major']}-master/puppet-passed-ci/delorean.repo", 'delorean-deps.repo' => "https://trunk.rdoproject.org/centos${::os['release']['major']}-master/delorean-deps.repo" @@ -60,9 +65,13 @@ class openstack_integration::repos { # NOTE(tobias-urdin): Mimic was never released by Storage SIG to official mirros. $ceph_mirror_fallback = $ceph_version_real ? { 'mimic' => "https://trunk.rdoproject.org/centos${::os['release']['major']}/deps/storage/storage${::os['release']['major']}-ceph-mimic/x86_64/", - default => "${::centos_mirror_host}/centos/${::os['release']['major']}/storage/x86_64/ceph-${ceph_version_real}/" + default => "${centos_mirror}/centos/${::os['release']['major']}/storage/x86_64/ceph-${ceph_version_real}/" + } + if defined('$::ceph_mirror_host') and $::ceph_mirror_host != '' { + $ceph_mirror = pick($::ceph_mirror_host, $ceph_mirror_fallback) + } else { + $ceph_mirror = $ceph_mirror_fallback } - $ceph_mirror = pick($::ceph_mirror_host, $ceph_mirror_fallback) # On CentOS, deploy Ceph using SIG repository and get rid of EPEL. # https://wiki.centos.org/SpecialInterestGroup/Storage/ if $::operatingsystem == 'CentOS' { diff --git a/playbooks/prepare-node-litmus.yaml b/playbooks/prepare-node-litmus.yaml new file mode 100644 index 000000000..1873cd98d --- /dev/null +++ b/playbooks/prepare-node-litmus.yaml @@ -0,0 +1,24 @@ +- hosts: all + tasks: + - shell: + cmd: | + set -e + set -x + + if [ -d /home/zuul/src/opendev.org/$ZUUL_PROJECT ]; then + cp -dR /home/zuul/src/opendev.org/$ZUUL_PROJECT/. . + else + git clone https://opendev.org/$ZUUL_PROJECT . + fi + if [ -d /home/zuul/src/opendev.org/openstack/puppet-openstack-integration ]; then + [ ! -d puppet-openstack-integration ] && mkdir puppet-openstack-integration + cp -dR /home/zuul/src/opendev.org/openstack/puppet-openstack-integration/. puppet-openstack-integration + else + git clone https://opendev.org/openstack/puppet-openstack-integration puppet-openstack-integration + fi + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - include_role: + name: bindep diff --git a/playbooks/run-litmus-tests.yaml b/playbooks/run-litmus-tests.yaml new file mode 100644 index 000000000..7275c8303 --- /dev/null +++ b/playbooks/run-litmus-tests.yaml @@ -0,0 +1,34 @@ +- hosts: all + tasks: + - name: Run Litmus + shell: + cmd: | + set -e + function trap_exit_sig() { + # NOTE(tobias-urdin): Litmus does not execute spec_clean rake task after a run. + $GEM_BIN_DIR/bundle exec rake spec_clean + + {{ ansible_user_dir }}/workspace/puppet-openstack-integration/copy_logs.sh + } + trap trap_exit_sig EXIT + export CEPH_VERSION={{ ceph }} + if [ "{{ puppet_gem_version }}" != "latest" ]; then + export PUPPET_GEM_VERSION='~> {{ puppet_gem_version }}' + fi + mkdir .bundled_gems + export GEM_HOME=`pwd`/.bundled_gems + export GEM_BIN_DIR=$GEM_HOME/bin + ruby <