Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix validation workflows #5

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pdk-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: "ubuntu-latest"
steps:
- name: "Clone repository"
uses: "actions/checkout@v2"
uses: "actions/checkout@v3"
- name: "Run pdk validate"
uses: "puppets-epic-show-theatre/action-pdk-validate@v1"
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
lintAllTheThings:
runs-on: "ubuntu-latest"
steps:
- uses: "actions/checkout@v1"
- uses: "actions/checkout@v3"
- name: "yaml-lint"
uses: "ibiqlik/action-yamllint@v3"
with:
Expand Down
50 changes: 28 additions & 22 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,36 @@ def location_for(place_or_version, fake_version = nil)
end

group :development do
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "voxpupuli-puppet-lint-plugins", '~> 4.0', require: false
gem "facterdb", '~> 1.18', require: false
gem "metadata-json-lint", '>= 2.0.2', '< 4.0.0', require: false
gem "puppetlabs_spec_helper", '~> 5.0', require: false
gem "rspec-puppet-facts", '~> 2.0', require: false
gem "codecov", '~> 0.2', require: false
gem "dependency_checker", '~> 0.2', require: false
gem "parallel_tests", '= 3.12.1', require: false
gem "pry", '~> 0.10', require: false
gem "simplecov-console", '~> 0.5', require: false
gem "puppet-debugger", '~> 1.0', require: false
gem "rubocop", '= 1.6.1', require: false
gem "rubocop-performance", '= 1.9.1', require: false
gem "rubocop-rspec", '= 2.0.1', require: false
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false
gem "facterdb", '~> 1.18', require: false
gem "metadata-json-lint", '~> 3.0', require: false
gem "puppetlabs_spec_helper", '~> 6.0', require: false
gem "rspec-puppet-facts", '~> 2.0', require: false
gem "codecov", '~> 0.2', require: false
gem "dependency_checker", '~> 1.0.0', require: false
gem "parallel_tests", '= 3.12.1', require: false
gem "pry", '~> 0.10', require: false
gem "simplecov-console", '~> 0.5', require: false
gem "puppet-debugger", '~> 1.0', require: false
gem "rubocop", '= 1.48.1', require: false
gem "rubocop-performance", '= 1.16.0', require: false
gem "rubocop-rspec", '= 2.19.0', require: false
gem "puppet-strings", '~> 4.0', require: false
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
end
group :system_tests do
gem "puppet_litmus", '< 1.0.0', require: false, platforms: [:ruby, :x64_mingw]
gem "serverspec", '~> 2.41', require: false
gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw]
gem "serverspec", '~> 2.41', require: false
end
group :release_prep do
gem "puppet-strings", '~> 4.0', require: false
gem "puppetlabs_spec_helper", '~> 6.0', require: false
end

puppet_version = ENV['PUPPET_GEM_VERSION']
Expand Down
3 changes: 1 addition & 2 deletions data/common.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
--- {}

---
letsencrypt::renew_additional_args:
- "--standalone"
letsencrypt::renew_pre_hook_commands:
Expand Down
10 changes: 5 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
# @param crons
# Hash of cron jobs to set up
#
# @param favorite_paths
# Array of paths to be added as favorites for the Files app
# @param enable_xdmod_export
# Whether to set up xdmod_export for ACCESS metrics
#
# @example
# include profile_ondemand
class profile_ondemand (
Boolean $enable_xdmod_export = false,
String $nodejs_version,
String $ruby_version,
Hash $crons,
Boolean $enable_xdmod_export = false,
) {
include apache::mod::rewrite
include apache::mod::env
Expand Down Expand Up @@ -67,8 +67,8 @@
}

letsencrypt::certonly { $facts['networking']['fqdn']:
plugin => 'standalone',
require => [
plugin => 'standalone',
require => [
Package['httpd'],
Class['openondemand'],
],
Expand Down
45 changes: 20 additions & 25 deletions manifests/xdmod_export.pp
Original file line number Diff line number Diff line change
@@ -1,75 +1,70 @@
# @summary Configure the xdmod export script
#
# @param enable_xdmod_export
# Whether to set up the script on the server. Defaults to false
#
# @param token
# Token used to authenticate with the log server
#
class profile_ondemand::xdmod_export (
String $token,
) {

user { 'xdmod-ondemand-export':
shell => '/bin/false',
shell => '/bin/false',
managehome => true,
password => '!DISABLED',
password => '!DISABLED',
}

exec { '/usr/bin/python3 -m venv /home/xdmod-ondemand-export/venv':
user => 'xdmod-ondemand-export',
user => 'xdmod-ondemand-export',
creates => '/home/xdmod-ondemand-export/venv',
require => Package['httpd'],
}
-> exec { 'python3 -m pip install xdmod-ondemand-export':
path => '/home/xdmod-ondemand-export/venv/bin:/usr/bin:/usr/sbin:/bin',
user => 'xdmod-ondemand-export',
path => '/home/xdmod-ondemand-export/venv/bin:/usr/bin:/usr/sbin:/bin',
user => 'xdmod-ondemand-export',
creates => '/home/xdmod-ondemand-export/venv/bin/xdmod-ondemand-export',
}
-> exec { 'setfacl -m u:xdmod-ondemand-export:r-x /etc/httpd/logs':
path => '/usr/bin:/usr/sbin:/bin',
path => '/usr/bin:/usr/sbin:/bin',
unless => 'getfacl /etc/httpd/logs/ | grep xdmod-ondemand-export',
}
-> exec { 'setfacl -m u:xdmod-ondemand-export:r-- /etc/httpd/logs/*':
path => '/usr/bin:/usr/sbin:/bin',
path => '/usr/bin:/usr/sbin:/bin',
unless => 'getfacl /etc/httpd/logs/* | grep xdmod-ondemand-export',
}
-> exec { 'setfacl -dm u:xdmod-ondemand-export:r-- /etc/httpd/logs':
path => '/usr/bin:/usr/sbin:/bin',
path => '/usr/bin:/usr/sbin:/bin',
unless => 'getfacl -d /etc/httpd/logs/ | grep xdmod-ondemand-export',
}

file { '/home/xdmod-ondemand-export/conf.ini':
ensure => 'file',
require => User['xdmod-ondemand-export'],
owner => 'xdmod-ondemand-export',
group => 'xdmod-ondemand-export',
mode => '0400',
owner => 'xdmod-ondemand-export',
group => 'xdmod-ondemand-export',
mode => '0400',
content => file('profile_ondemand/xdmod_export_conf.ini'),
}

file { '/home/xdmod-ondemand-export/.token':
ensure => 'file',
replace => false,
require => User['xdmod-ondemand-export'],
owner => 'xdmod-ondemand-export',
group => 'xdmod-ondemand-export',
mode => '0600',
owner => 'xdmod-ondemand-export',
group => 'xdmod-ondemand-export',
mode => '0600',
content => $token,
}

file { '/home/xdmod-ondemand-export/last-run.json':
ensure => 'present',
ensure => 'file',
require => User['xdmod-ondemand-export'],
owner => 'xdmod-ondemand-export',
group => 'xdmod-ondemand-export',
mode => '0600',
owner => 'xdmod-ondemand-export',
group => 'xdmod-ondemand-export',
mode => '0600',
}

cron { 'xdmod-ondemand-export':
command => "su -c '/home/xdmod-ondemand-export/venv/bin/xdmod-ondemand-export' -s /bin/bash xdmod-ondemand-export",
hour => fqdn_rand(24),
minute => fqdn_rand(60),
hour => fqdn_rand(24),
minute => fqdn_rand(60),
}

}
Loading