Skip to content
Snippets Groups Projects
Commit 1c91e1e4 authored by Christophe Haen's avatar Christophe Haen
Browse files

Merge branch 'qa' into 'master'

Qa

See merge request ai/it-puppet-module-dirac!108
parents dcaff38f d50b62ef
No related branches found
No related tags found
No related merge requests found
# maintained by modulesync
code/pkg/
code/rspec.xml
code/rspec*.xml
code/Gemfile.lock
code/vendor/
code/spec/fixtures/manifests/
......
......@@ -30,15 +30,15 @@ alma9-puppet-ci:
CONTEXT_DIR: .
DOCKER_FILE: ci/Dockerfile
FROM: gitlab-registry.cern.ch/linuxsupport/alma9-base
TO: ${CI_REGISTRY_IMAGE}:alma9-puppet-ci-2.8.0
TO: ${CI_REGISTRY_IMAGE}:alma9-puppet-ci-2.9.1
.rake_template: &rake_template
stage: tests
image: gitlab-registry.cern.ch/ai/it-puppet-module-ci_images:alma9-puppet-ci-2.8.0
image: gitlab-registry.cern.ch/ai/it-puppet-module-ci_images:alma9-puppet-ci-2.9.1
artifacts:
reports:
junit: code/rspec.xml
junit: code/rspec*.xml
script:
- eval "$(rbenv init - bash)"
- rbenv global ${RUBY_VERSION}
......@@ -51,7 +51,6 @@ alma9-puppet-ci:
puppet7:
variables:
SPEC_OPTS: "--format progress --format RspecJunitFormatter --out rspec.xml"
RUBY_VERSION: "2.7.8"
FACTER_GEM_VERSION: "~> 4.0"
PUPPET_VERSION: "~> 7.24.0"
......@@ -62,7 +61,6 @@ puppet7:
puppet8:
variables:
SPEC_OPTS: "--format progress --format RspecJunitFormatter --out rspec.xml"
RUBY_VERSION: "3.2.2"
FACTER_GEM_VERSION: "~> 4.0"
PUPPET_VERSION: "~> 8.0"
......@@ -74,7 +72,6 @@ puppet8:
rubocop:
variables:
SPEC_OPTS: "--format progress --format RspecJunitFormatter --out rspec.xml"
RUBY_VERSION: "2.7.8"
FACTER_GEM_VERSION: "~> 4.0"
PUPPET_VERSION: "~> 7.0"
......@@ -84,7 +81,7 @@ rubocop:
yaml-validate:
stage: tests
image: gitlab-registry.cern.ch/ai/it-puppet-module-ci_images:alma9-puppet-ci-2.8.0
image: gitlab-registry.cern.ch/ai/it-puppet-module-ci_images:alma9-puppet-ci-2.9.1
script:
- if [ -d data ] && [ -d code/data ] ; then echo "Directory data and code/data cannot both exist." ; /bin/false ; else true; fi
- if [ -d data ] ; then yaml-lint data ; else true; fi
......@@ -93,3 +90,8 @@ yaml-validate:
- if [ -d code/data ] ; then ruby ci/extra-yaml-checks.rb code/data module ; fi
- if [ -f .sync.yml ] ; then yaml-lint .sync.yml ; else true; fi
rspec-unused:
stage: tests
image: gitlab-registry.cern.ch/ai/it-puppet-module-ci_images:alma9-puppet-ci-2.9.1
script: /usr/bin/bash ci/extra-rspec-checks.sh
modulesync_config_version: '2.8.0'
modulesync_config_version: '2.9.1'
......@@ -13,7 +13,7 @@
# podman build --build-arg GITLAB_ACCESS_TOKEN=<your_token> --build-arg SPEC=spec/defines/alias_spec.rb .
#
#
FROM gitlab-registry.cern.ch/ai/it-puppet-module-ci_images:alma9-puppet-ci-2.8.0
FROM gitlab-registry.cern.ch/ai/it-puppet-module-ci_images:alma9-puppet-ci-2.9.1
WORKDIR /opt/puppet
......
......@@ -7,11 +7,12 @@ FROM gitlab-registry.cern.ch/linuxsupport/alma9-base
# Declare a build argument to receive AI_CI_SSH_KEY
ARG AI_CI_SSH_KEY
#
# # Docker really has no HERE doc?
#
#
RUN mkdir -p ~/.ssh && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
# # Docker now has HERE docs but Kaniko does not.
#
RUN mkdir -p ~/.ssh && \
echo -e "Host *\n\tStrictHostKeyChecking no" > ~/.ssh/config && \
echo -e "\tControlMaster auto\n\tControlPath ~/.ssh/ssh-%r@%h:%p" >> ~/.ssh/config && \
echo -e "\tControlPersist yes" >> ~/.ssh/config
RUN dnf clean all && dnf -y update && \
dnf -y install epel-release redhat-rpm-config \
......
......@@ -8,7 +8,7 @@ end
RuboCop::RakeTask.new(:rubocop) do |task|
# These make the rubocop experience maybe slightly less terrible
task.options = ['-D', '-S', '-E']
task.options = ['-D', '-S', '-E', '--format', 'progress', '--format', 'junit', '--out', 'rspec.xml']
end
PuppetLint.configuration.log_format = '%{path}:%{line}:%{check}:%{KIND}:%{message}'
......
--format progress
--format RspecJunitFormatter
--out rspec<%= ENV['TEST_ENV_NUMBER'] %>.xml
......@@ -17,20 +17,12 @@
{
"operatingsystem": "AlmaLinux",
"operatingsystemrelease": [
"7",
"8"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7",
"8",
"9"
]
},
{
"operatingsystem": "CentOS",
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7",
"8",
......
#!/bin/bash
# look for RSPEC files that should end with "_rspec.rb" in order to be considered.
# try to ignore things that will just be included elsewhere.
if [[ -d code/spec ]]; then
find code/spec -name '*_spec.rb' -o -name 'helper*.rb' -o \( -name '*.rb' -print0 \) |\
xargs --null --no-run-if-empty grep -l "^describe" &&\
{ echo "ERROR: RSPEC testcases must end in '_spec.rb' to be used" >&1; exit 1; };
fi
true
......@@ -285,14 +285,14 @@ class dirac (String $dirac_user = 'dirac', String $dirac_group = 'dirac',
include nftables::rules::https
nftables::simplerule {'100_allow_ipv4_ports_to_the_world':
proto => 'tcp',
dport => '9130-9200',
dport => [8443,'9130-9200'],
action => 'accept',
}
nftables::simplerule {'100_allow_ipv6_ports_to_the_world':
set_type => 'ip6',
proto => 'tcp',
dport => '9130-9200',
dport => [8443,'9130-9200'],
action => 'accept',
}
}
......@@ -304,7 +304,7 @@ class dirac (String $dirac_user = 'dirac', String $dirac_group = 'dirac',
if versioncmp($facts['os']['release']['major'],'6') == 0 {
notify { 'Cannot install logstash on SLC6':}
}
elsif versioncmp($facts['os']['release']['major'], '7') == 0 {
elsif versioncmp($facts['os']['release']['major'], '7') >= 0 {
# Install logstash repository
yumrepo { 'logstash-8.x':
......@@ -319,14 +319,31 @@ class dirac (String $dirac_user = 'dirac', String $dirac_group = 'dirac',
# Define logstash version and disable ecs compatibility
# https://forge.puppet.com/modules/puppet/yum/readme#centos-7-and-older
yum::versionlock{'1:logstash-oss-8.9.0-1.x86_64':
ensure => present,
before => Package['logstash'],
$logstash_version = '8.13.1'
if versioncmp($facts['os']['release']['major'],'7') == 0 {
yum::versionlock{"1:logstash-oss-${logstash_version}-1.x86_64":
ensure => present,
before => Package['logstash'],
}
}
-> class { 'logstash':
version => '8.9.0',
settings => { 'pipeline.ecs_compatibility' => 'disabled', },
elsif versioncmp($facts['os']['release']['major'], '8') >= 0 {
yum::versionlock{'logstash':
ensure => present,
version => $logstash_version,
release => '1.*',
epoch => 1,
arch => 'x86_64',
}
}
-> class { 'logstash':
version => $logstash_version,
settings => { 'pipeline.ecs_compatibility' => 'disabled', },
jvm_options => [
'-Xms1g',
'-Xmx1g',
],
}
# Install opensearch output plugin
logstash::plugin { ['logstash-output-opensearch']: }
......@@ -338,14 +355,45 @@ class dirac (String $dirac_user = 'dirac', String $dirac_group = 'dirac',
# Generate the config file for logstash with Teigi,
# and then declare it to logstash class
teigi::secret::sub_file{'/tmp/logstashConfigTeigi.cfg':
# a fuller example, including permissions and ownership
file { '/tmp/logstash/':
ensure => 'directory',
owner => 'logstash',
mode => '0750',
}
->teigi::secret::sub_file{'/tmp/logstash/logstashConfigTeigi.cfg':
teigi_keys => $teigi_keys,
content => template($logstash_tpl_path),
mode => '0640',
owner => 'logstash',
}
-> logstash::configfile { 'configname':
source => '/tmp/logstashConfigTeigi.cfg',
source => '/tmp/logstash/logstashConfigTeigi.cfg',
}
-> file_line{'patch logstash connect':
path => '/usr/share/logstash/vendor/bundle/jruby/3.1.0/gems/logstash-input-stomp-3.0.8/lib/logstash/inputs/stomp.rb',
line => ' connect',
match => ' self.connect',
}
# As of some ruby version, the URI module changed its way to declare new scheme
# it went from
# @@schemes['RSYNC'] = RSYNC
# to
# register_scheme 'RSYNC', RSYNC
# but it does not support protocol with + or . !
# so we delete it
# https://github.com/ruby/uri/issues/89
-> file_line{'patch onstomp scheme stomp':
path => '/usr/share/logstash/vendor/bundle/jruby/3.1.0/gems/onstomp-1.0.12/lib/onstomp/components/uri.rb',
match => " @@schemes\\['STOMP'\\] = OnStomp::Components::URI::STOMP",
line => " register_scheme 'STOMP', OnStomp::Components::URI::STOMP",
}
-> file_line{'patch onstomp scheme ssl_stomp':
ensure => absent,
path => '/usr/share/logstash/vendor/bundle/jruby/3.1.0/gems/onstomp-1.0.12/lib/onstomp/components/uri.rb',
line => " @@schemes['STOMP+SSL'] = OnStomp::Components::URI::STOMP_SSL",
match => " @@schemes\\['STOMP\\+SSL'\\] = OnStomp::Components::URI::STOMP_SSL",
match_for_absence => true,
}
logstash::plugin { 'logstash-input-stomp': }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment