Skip to content

Commit

Permalink
Remove EL7 compatibility from jenkins_node module
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohl committed May 17, 2024
1 parent d5df303 commit 67be4c1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 44 deletions.
37 changes: 8 additions & 29 deletions puppet/modules/jenkins_node/manifests/packaging/rpm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,20 @@
String $user,
Stdlib::Absolutepath $workspace,
) {
$is_el7 = $facts['os']['release']['major'] == '7'
$ansible_python_version = if $facts['os']['release']['major'] == '8' { 'python3.11' } else { 'python3' }

package { ['rpm-build', 'createrepo', 'copr-cli', 'rpmlint']:
ensure => installed,
}

unless $is_el7 {
yumrepo { 'git-annex':
name => 'git-annex',
baseurl => 'https://downloads.kitenet.net/git-annex/linux/current/rpms/',
enabled => '1',
gpgcheck => '0',
} ->
package { ['git-annex-standalone']:
ensure => installed,
}
} else {
package { ['git-annex', 'pyliblzma']:
ensure => installed,
}
yumrepo { 'git-annex':
name => 'git-annex',
baseurl => 'https://downloads.kitenet.net/git-annex/linux/current/rpms/',
enabled => '1',
gpgcheck => '0',
} ->
package { ['git-annex-standalone']:
ensure => installed,
}

$obal_packages = [
Expand Down Expand Up @@ -69,20 +62,6 @@
ensure => present,
}

# Needed for EL8 repoclosure on EL7 nodes
if $facts['os']['family'] == 'RedHat' {
if $facts['os']['name'] == 'RedHat' {
yumrepo { 'rhel-7-server-rhui-extras-rpms':
enabled => true,
before => Package['dnf'],
}
} else {
yumrepo { 'rhel-7-server-rhui-extras-rpms':
ensure => absent,
}
}
}

package { ['dnf', 'dnf-plugins-core']:
ensure => present,
}
Expand Down
11 changes: 1 addition & 10 deletions puppet/modules/jenkins_node/manifests/unittests.pp
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,9 @@
}
}

# Needed at least for libyaml-devel on our RHEL builders in AWS
if $facts['os']['name'] == 'RedHat' and $facts['os']['release']['major'] == '7' {
yumrepo { 'rhel-7-server-rhui-optional-rpms':
enabled => '1',
}
}

# Databases
include jenkins_node::postgresql

# rbenv
if $facts['os']['family'] == 'RedHat' and $facts['os']['release']['major'] != '7' {
include jenkins_node::rbenv
}
include jenkins_node::rbenv
}
7 changes: 2 additions & 5 deletions puppet/spec/classes/jenkins_node_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,8 @@
it { is_expected.to compile.with_all_deps }
it { is_expected.not_to contain_class('jenkins_node::packaging') }
it { is_expected.to contain_class('jenkins_node::postgresql') }

if ['9', '8'].include?(facts[:operatingsystemrelease])
it { is_expected.to contain_class('jenkins_node::rbenv') }
it { is_expected.to contain_exec('rbenv-install-2.7.6').with_user('jenkins') }
end
it { is_expected.to contain_class('jenkins_node::rbenv') }
it { is_expected.to contain_exec('rbenv-install-2.7.6').with_user('jenkins') }
end
end
end
Expand Down

0 comments on commit 67be4c1

Please sign in to comment.