Skip to content

Commit

Permalink
Merge pull request #1354 from bastelfreak/vz
Browse files Browse the repository at this point in the history
Add VirtuozzoLinux support
  • Loading branch information
bastelfreak committed Nov 17, 2019
2 parents bdc716a + 6429b1b commit 1cbde6c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
7 changes: 4 additions & 3 deletions manifests/package/redhat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@
#clone and provide the Red Hat-specific package. This comes into play when not
#on RHEL or CentOS and $manage_repo is set manually to 'true'.
$_os = $facts['os']['name'] ? {
'centos' => 'centos',
default => 'rhel'
'centos' => 'centos',
'VirtuozzoLinux' => 'centos',
default => 'rhel'
}

if $manage_repo {
Expand Down Expand Up @@ -70,7 +71,7 @@
}
}
'passenger': {
if ($facts['os']['name'] in ['RedHat', 'CentOS']) and ($facts['os']['release']['major'] in ['6', '7']) {
if ($facts['os']['name'] in ['RedHat', 'CentOS', 'VirtuozzoLinux']) and ($facts['os']['release']['major'] in ['6', '7']) {
yumrepo { 'passenger':
baseurl => "https://oss-binaries.phusionpassenger.com/yum/passenger/el/${facts['os']['release']['major']}/\$basearch",
descr => 'passenger repo',
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
}
}
'RedHat': {
if ($facts['os']['name'] in ['RedHat', 'CentOS', 'Oracle'] and $facts['os']['release']['major'] in ['6', '7']) {
if ($facts['os']['name'] in ['RedHat', 'CentOS', 'Oracle', 'virtuozzolinux'] and $facts['os']['release']['major'] in ['6', '7']) {
$_module_os_overrides = {
'manage_repo' => true,
'log_group' => 'nginx',
Expand Down
7 changes: 7 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@
"7"
]
},
{
"operatingsystem": "VirtuozzoLinux",
"operatingsystemrelease": [
"6",
"7"
]
},
{
"operatingsystem": "SLES"
},
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/nginx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
it { is_expected.to contain_package('nginx') }
it do
is_expected.to contain_yumrepo('nginx-release').with(
'baseurl' => "https://nginx.org/packages/#{facts[:operatingsystem] == 'CentOS' ? 'centos' : 'rhel'}/#{facts[:operatingsystemmajrelease]}/$basearch/",
'baseurl' => "https://nginx.org/packages/#{%w[CentOS VirtuozzoLinux].include?(facts[:operatingsystem]) ? 'centos' : 'rhel'}/#{facts[:operatingsystemmajrelease]}/$basearch/",
'descr' => 'nginx repo',
'enabled' => '1',
'gpgcheck' => '1',
Expand All @@ -66,7 +66,7 @@
it { is_expected.to contain_package('nginx') }
it do
is_expected.to contain_yumrepo('nginx-release').with(
'baseurl' => "https://nginx.org/packages/#{facts[:operatingsystem] == 'CentOS' ? 'centos' : 'rhel'}/#{facts[:operatingsystemmajrelease]}/$basearch/",
'baseurl' => "https://nginx.org/packages/#{%w[CentOS VirtuozzoLinux].include?(facts[:operatingsystem]) ? 'centos' : 'rhel'}/#{facts[:operatingsystemmajrelease]}/$basearch/",
'descr' => 'nginx repo',
'enabled' => '1',
'gpgcheck' => '1',
Expand All @@ -83,7 +83,7 @@

it do
is_expected.to contain_yumrepo('nginx-release').with(
'baseurl' => "https://nginx.org/packages/mainline/#{facts[:operatingsystem] == 'CentOS' ? 'centos' : 'rhel'}/#{facts[:operatingsystemmajrelease]}/$basearch/"
'baseurl' => "https://nginx.org/packages/mainline/#{%w[CentOS VirtuozzoLinux].include?(facts[:operatingsystem]) ? 'centos' : 'rhel'}/#{facts[:operatingsystemmajrelease]}/$basearch/"
)
end
it do
Expand Down

0 comments on commit 1cbde6c

Please sign in to comment.