Skip to content

Commit

Permalink
Support OnDemand 3.1
Browse files Browse the repository at this point in the history
* Drop EL7 support - fixes #147
* Amazon 2023 support - fixes #127
* Support aarch64 (no changes) - fixes #128
* Support ppc64le (no changes) - fixes #133
* Update to NodeJS 18 and Ruby 3.1 for EL8 and EL9 - fixes #134
* Support Debian 12 - fixes #139
* Use NodeJS nodistro repos - fixes #140
* Add 'disable_logs' parameter - fixes #149
* Add 'custom_vhost_directives' and 'custom_location_directives' parameters - fixes #152
  • Loading branch information
treydock committed Jan 25, 2024
1 parent b32fa9c commit 4c6406b
Show file tree
Hide file tree
Showing 15 changed files with 153 additions and 169 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ jobs:
fail-fast: false
matrix:
set:
- "el7"
- "el8"
- "el9"
- "amazon2023"
- "ubuntu-2004"
- "ubuntu-2204"
- "debian-12"
puppet:
- "puppet7"
- "puppet8"
Expand Down
14 changes: 10 additions & 4 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ Rakefile:
- '0 6 * * 1'
acceptance_matrix:
set:
- el7
- ---el7
- el8
- el9
- amazon2023
- ubuntu-2004
- ubuntu-2204
- debian-12
puppet:
- puppet7
- puppet8
Expand All @@ -20,9 +22,7 @@ Rakefile:
appveyor.yml:
delete: true
spec/acceptance/nodesets/el7.yml:
default_module_install_opts:
ignore-dependencies: ~
force: ~
delete: true
spec/acceptance/nodesets/el8.yml:
default_module_install_opts:
ignore-dependencies: ~
Expand Down Expand Up @@ -51,3 +51,9 @@ spec/acceptance/nodesets/ubuntu-2204.yml:
default_module_install_opts:
ignore-dependencies: ~
force: ~
spec/acceptance/nodesets/debian-12.yml:
packages:
- cron
default_module_install_opts:
ignore-dependencies: ~
force: ~
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Manage [Open OnDemand](http://openondemand.org/) installation and configuration.

The following are the versions of this module and the supported versions of Open OnDemand:

* Module 3.x and 4.x supports Open OnDemand 3.x
* Module 5.x supports Open OnDemand 3.1
* Module 3.x and 4.x supports Open OnDemand 3.0
* Module 2.x supports Open OnDemand 2.x
* Module 1.x supports Open OnDemand 1.18.x
* Module <= 0.12.0 supports Open OnDemand <= 1.7
Expand Down Expand Up @@ -55,8 +56,6 @@ If you already declare the apache class you may wish to only include apache in t
```yaml
openondemand::declare_apache: false
apache::version::scl_httpd_version: '2.4'
apache::version::scl_php_version: '7.0'
apache::default_vhost: false
```
Expand Down Expand Up @@ -357,8 +356,9 @@ openondemand::confs:

This module has been tested on:

* RedHat/CentOS 7 x86_64
* RedHat/Rocky Linux/Alma Linux 8 x86_64
* RedHat/Rocky Linux/Alma Linux 9 x86_64
* Ubuntu 18.04 x86_64
* Ubuntu 20.04 x86_64
* RedHat/Rocky Linux/Alma Linux 8
* RedHat/Rocky Linux/Alma Linux 9
* Amazon Linux 2023
* Ubuntu 20.04
* Ubuntu 22.04
* Debian 12
9 changes: 1 addition & 8 deletions data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,4 @@ openondemand::nginx_stage_app_root:
dev: "/var/www/ood/apps/dev/%{literal('%')}{owner}/gateway/%{literal('%')}{name}"
usr: "/var/www/ood/apps/usr/%{literal('%')}{owner}/gateway/%{literal('%')}{name}"
sys: "/var/www/ood/apps/sys/%{literal('%')}{name}"
openondemand::basic_auth_users:
ood:
password: ood
openondemand::auth_configs:
- 'AuthName "Private"'
- 'AuthUserFile "/opt/rh/httpd24/root/etc/httpd/.htpasswd"'
- 'RequestHeader unset Authorization'
- 'Require valid-user'

1 change: 0 additions & 1 deletion data/os/RedHat/7.yaml

This file was deleted.

28 changes: 3 additions & 25 deletions manifests/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,17 @@
assert_private()

if $openondemand::declare_apache {
if $openondemand::scl_apache {
class { 'apache::version':
scl_httpd_version => '2.4',
scl_php_version => '7.0',
}
}
class { 'apache':
default_vhost => false,
}
} else {
contain apache
}

if $openondemand::scl_apache {
$package_prefix = 'httpd24-'
} else {
$package_prefix = ''
}

if $facts['os']['family'] == 'RedHat' {
$session_package = "${package_prefix}mod_session"
$proxy_html_package = "${package_prefix}mod_proxy_html"
$openidc_package = "${package_prefix}mod_auth_openidc"
$session_package = 'mod_session'
$proxy_html_package = 'mod_proxy_html'
$openidc_package = 'mod_auth_openidc'
} else {
$session_package = undef
$proxy_html_package = undef
Expand Down Expand Up @@ -71,16 +59,6 @@
}
}

if $openondemand::scl_apache {
shellvar { 'HTTPD24_HTTPD_SCLS_ENABLED':
ensure => 'present',
target => '/opt/rh/httpd24/service-environment',
value => $openondemand::apache_scls,
require => Package['httpd'],
notify => Class['Apache::Service'],
}
}

systemd::dropin_file { 'ood.conf':
unit => "${apache::service_name}.service",
content => join([
Expand Down
28 changes: 16 additions & 12 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
# Boolean that determines if apache is declared or included
# @param apache_user
# Name of the Apache user
# @param apache_scls
# SCLs to load when starting Apache service
# @param generator_insecure
# Run ood-portal-generator with --insecure flag
# This is needed if you wish to use default ood@localhost user or
Expand All @@ -46,6 +44,8 @@
# ood_porta.yml server_aliases
# @param ssl
# ood_portal.yml ssl
# @param disable_logs
# ood_portal.yml disable_logs
# @param logroot
# ood_portal.yml logroot
# @param use_rewrites
Expand Down Expand Up @@ -78,6 +78,10 @@
# ood_portal.yml auth_type
# @param auth_configs
# ood_portal.yml auth_configs
# @param custom_vhost_directives
# ood_portal.yml custom_vhost_directives
# @param custom_location_directives
# ood_portal.yml custom_location_directives
# @param root_uri
# ood_portal.yml root_uri
# @param analytics
Expand Down Expand Up @@ -234,7 +238,7 @@
#
class openondemand (
# repos
String $repo_release = '3.0',
String $repo_release = '3.1',
Variant[Stdlib::HTTPSUrl, Stdlib::HTTPUrl]
$repo_baseurl_prefix = 'https://yum.osc.edu/ondemand',
Variant[Stdlib::HTTPSUrl, Stdlib::HTTPUrl, Stdlib::Absolutepath]
Expand All @@ -256,14 +260,14 @@
# Apache
Boolean $declare_apache = true,
String[1] $apache_user = 'apache',
String $apache_scls = 'httpd24',

# ood_portal.yml
Boolean $generator_insecure = false,
Variant[Array, String, Undef] $listen_addr_port = undef,
Optional[String] $servername = undef,
Optional[Array] $server_aliases = undef,
Optional[Array] $ssl = undef,
Boolean $disable_logs = false,
String $logroot = 'logs',
Boolean $use_rewrites = true,
Boolean $use_maintenance = true,
Expand All @@ -280,6 +284,8 @@
Optional[String] $map_fail_uri = undef,
Variant[Enum['CAS', 'openid-connect', 'shibboleth', 'dex'], String[1]] $auth_type = 'dex',
Optional[Array] $auth_configs = undef,
Array $custom_vhost_directives = [],
Array $custom_location_directives = [],
String $root_uri = '/pun/sys/dashboard',
Optional[Struct[{ url => String, id => String }]] $analytics = undef,
String $public_uri = '/public',
Expand Down Expand Up @@ -381,18 +387,12 @@
$osname = $facts.dig('os', 'name')
$osmajor = $facts.dig('os', 'release', 'major')

$supported = ['RedHat-7','RedHat-8','RedHat-9','Debian-20.04','Debian-22.04']
$supported = ['RedHat-7','RedHat-8','RedHat-9','RedHat-2023','Debian-20.04','Debian-22.04','Debian-12']
$os = "${osfamily}-${osmajor}"
if ! ($os in $supported) {
fail("Unsupported OS: module ${module_name}. osfamily=${osfamily} osmajor=${osmajor} detected")
}

if versioncmp($osmajor, '7') <= 0 {
$scl_apache = true
} else {
$scl_apache = false
}

if $selinux {
$selinux_package_ensure = $ondemand_package_ensure
} else {
Expand Down Expand Up @@ -477,6 +477,7 @@
'server_aliases' => $server_aliases,
'port' => $port,
'ssl' => $ssl,
'disable_logs' => $disable_logs,
'logroot' => $logroot,
'use_rewrites' => $use_rewrites,
'use_maintenance' => $use_maintenance,
Expand All @@ -491,6 +492,8 @@
'map_fail_uri' => $map_fail_uri,
'pun_stage_cmd' => $pun_stage_cmd,
'auth' => $auth,
'custom_vhost_directives' => $custom_vhost_directives,
'custom_location_directives' => $custom_location_directives,
'root_uri' => $root_uri,
'analytics' => $analytics,
'public_uri' => $public_uri,
Expand Down Expand Up @@ -544,7 +547,8 @@
if $osfamily == 'RedHat' {
contain openondemand::repo::rpm
Class['openondemand::repo::rpm'] -> Class['openondemand::install']
} elsif $osfamily == 'Debian' {
}
if $osfamily == 'Debian' {
contain openondemand::repo::apt
Class['openondemand::repo::apt'] -> Class['openondemand::install']
}
Expand Down
21 changes: 12 additions & 9 deletions manifests/repo/apt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@
},
}

apt::source { 'nodesource':
ensure => 'present',
location => 'https://deb.nodesource.com/node_14.x',
repos => 'main',
release => $facts['os']['distro']['codename'],
key => {
'id' => '9FD3B784BC1C6FC31A8A0A1C1655A0AB68576280',
'source' => 'https://deb.nodesource.com/gpgkey/nodesource.gpg.key',
},
# Debian 12 has NodeJS 18 in OS repos
if String($openondemand::osmajor) != '12' {
apt::source { 'nodesource':
ensure => 'present',
location => 'https://deb.nodesource.com/node_18.x',
repos => 'main',
release => 'nodistro',
key => {
'id' => '6F71F525282841EEDAF851B42F59B5F99B1BE0B4',
'source' => 'https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key',
},
}
}
}
30 changes: 3 additions & 27 deletions manifests/repo/rpm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -56,38 +56,14 @@
contain epel
}

if versioncmp($openondemand::osmajor, '7') <= 0 and $openondemand::manage_dependency_repos {
if $facts['os']['name'] == 'CentOS' and versioncmp($openondemand::osmajor, '7') == 0 {
file { '/etc/yum.repos.d/ondemand-centos-scl.repo':
ensure => 'absent',
}
}

case $facts['os']['name'] {
'RedHat': {
rh_repo { "rhel-server-rhscl-${openondemand::osmajor}-rpms":
ensure => 'present',
}
}
'CentOS': {
package { 'centos-release-scl':
ensure => 'installed',
}
}
default: {
# Do nothing
}
}
}

if versioncmp($openondemand::osmajor, '8') == 0 and $openondemand::manage_dependency_repos {
if String($openondemand::osmajor) in ['8', '9'] and $openondemand::manage_dependency_repos {
package { 'nodejs':
ensure => '14',
ensure => '18',
enable_only => true,
provider => 'dnfmodule',
}
package { 'ruby':
ensure => '3.0',
ensure => '3.1',
enable_only => true,
provider => 'dnfmodule',
}
Expand Down
21 changes: 13 additions & 8 deletions metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
}
],
"operatingsystem_support": [
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7"
]
},
{
"operatingsystem": "Rocky",
"operatingsystemrelease": [
Expand All @@ -69,17 +63,28 @@
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7",
"8",
"9"
]
},
{
"operatingsystem": "Amazon",
"operatingsystemrelease": [
"2023"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"20.04",
"22.04"
]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"12"
]
}
],
"requirements": [
Expand All @@ -95,5 +100,5 @@
],
"pdk-version": "2.7.1",
"template-url": "https://github.com/treydock/pdk-templates.git#master",
"template-ref": "heads/master-0-g76f4dbb"
"template-ref": "heads/master-0-ge8bcc28"
}
Loading

0 comments on commit 4c6406b

Please sign in to comment.