From 0e15f5eb213a375fd0adea6bce25b44f100fc084 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Feb 2026 22:17:56 +0000 Subject: [PATCH 1/9] Bump faraday from 2.13.4 to 2.14.1 Bumps [faraday](https://github.com/lostisland/faraday) from 2.13.4 to 2.14.1. - [Release notes](https://github.com/lostisland/faraday/releases) - [Changelog](https://github.com/lostisland/faraday/blob/main/CHANGELOG.md) - [Commits](https://github.com/lostisland/faraday/compare/v2.13.4...v2.14.1) --- updated-dependencies: - dependency-name: faraday dependency-version: 2.14.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 379dfbf..f047223 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -77,14 +77,14 @@ GEM thor (>= 1.0.1, < 2.0) facterdb (3.9.0) jgrep (~> 1.5, >= 1.5.4) - faraday (2.13.4) + faraday (2.14.1) faraday-net_http (>= 2.0, < 3.5) json logger faraday-follow_redirects (0.3.0) faraday (>= 1, < 3) - faraday-net_http (3.4.1) - net-http (>= 0.5.0) + faraday-net_http (3.4.2) + net-http (~> 0.5) fast_gettext (2.4.0) prime ffi (1.17.2-x86_64-linux-gnu) @@ -98,7 +98,7 @@ GEM in-parallel (1.0.1) inifile (3.0.0) jgrep (1.5.4) - json (2.13.2) + json (2.18.1) json-schema (5.2.1) addressable (~> 2.8) bigdecimal (~> 3.1) @@ -116,8 +116,8 @@ GEM mocha (2.7.1) ruby2_keywords (>= 0.0.5) multi_json (1.17.0) - net-http (0.6.0) - uri + net-http (0.9.1) + uri (>= 0.11.1) net-scp (4.1.0) net-ssh (>= 2.6.5, < 8.0.0) net-ssh (7.3.0) @@ -288,7 +288,7 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (1.8.0) - uri (1.0.4) + uri (1.1.1) wisper (2.0.1) zeitwerk (2.7.3) From aec7f4a0d1f939c8fd78233ddcac72076e77e906 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Mar 2026 12:52:42 +0000 Subject: [PATCH 2/9] Bump json from 2.18.1 to 2.19.2 Bumps [json](https://github.com/ruby/json) from 2.18.1 to 2.19.2. - [Release notes](https://github.com/ruby/json/releases) - [Changelog](https://github.com/ruby/json/blob/master/CHANGES.md) - [Commits](https://github.com/ruby/json/compare/v2.18.1...v2.19.2) --- updated-dependencies: - dependency-name: json dependency-version: 2.19.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index f047223..89d8339 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -98,7 +98,7 @@ GEM in-parallel (1.0.1) inifile (3.0.0) jgrep (1.5.4) - json (2.18.1) + json (2.19.2) json-schema (5.2.1) addressable (~> 2.8) bigdecimal (~> 3.1) From 1b4b6d72cd83c2063a3597b009c4f49c90cf3fc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 09:26:52 +0000 Subject: [PATCH 3/9] Bump addressable from 2.8.7 to 2.9.0 Bumps [addressable](https://github.com/sporkmonger/addressable) from 2.8.7 to 2.9.0. - [Changelog](https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md) - [Commits](https://github.com/sporkmonger/addressable/compare/addressable-2.8.7...addressable-2.9.0) --- updated-dependencies: - dependency-name: addressable dependency-version: 2.9.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 89d8339..5975724 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -29,8 +29,8 @@ GEM minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - addressable (2.8.7) - public_suffix (>= 2.0.2, < 7.0) + addressable (2.9.0) + public_suffix (>= 2.0.2, < 8.0) ansi (1.5.0) artii (2.1.2) ast (2.4.3) @@ -149,7 +149,7 @@ GEM forwardable singleton prism (1.4.0) - public_suffix (6.0.2) + public_suffix (7.0.5) puppet (7.34.0) concurrent-ruby (~> 1.0) deep_merge (~> 1.0) From afc9a2e9ffd53fce70dfc0e6cd4c06ae08d4599a Mon Sep 17 00:00:00 2001 From: ulhpc-bot <282622861+ULHPC-bot@users.noreply.github.com> Date: Thu, 7 May 2026 15:14:56 +0000 Subject: [PATCH 4/9] modulesync --- .devcontainer/devcontainer.json | 4 ++ .editorconfig | 15 +++++ .github/ISSUE_TEMPLATE.md | 26 +++++++++ .github/PULL_REQUEST_TEMPLATE.md | 20 +++++++ .github/labeler.yml | 6 ++ .github/release.yml | 42 ++++++++++++++ .github/workflows/ci.yml | 25 ++++++++ .github/workflows/create_tag.yml | 22 +++++++ .github/workflows/labeler.yml | 22 +++++++ .github/workflows/prepare_release.yml | 30 ++++++++++ .github/workflows/release.yml | 28 +++++++++ .gitignore | 30 ++++++++-- .msync.yml | 5 ++ .overcommit.yml | 67 ++++++++++++++++++++++ .pmtignore | 41 +++++++++++++- .puppet-lint.rc | 6 ++ .rubocop.yml | 6 ++ .ruby-version | 1 - Gemfile | 52 +++++++---------- Rakefile | 82 +++++++++------------------ spec/spec_helper.rb | 24 ++++++++ 21 files changed, 460 insertions(+), 94 deletions(-) create mode 100644 .devcontainer/devcontainer.json create mode 100644 .editorconfig create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/labeler.yml create mode 100644 .github/release.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/create_tag.yml create mode 100644 .github/workflows/labeler.yml create mode 100644 .github/workflows/prepare_release.yml create mode 100644 .github/workflows/release.yml create mode 100644 .msync.yml create mode 100644 .overcommit.yml create mode 100644 .puppet-lint.rc create mode 100644 .rubocop.yml delete mode 100644 .ruby-version create mode 100644 spec/spec_helper.rb diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..08c6abf --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,4 @@ +{ + "name": "VoxBox", + "image": "ghcr.io/voxpupuli/voxbox:latest" +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..ecb10a8 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +# editorconfig.org + +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 2 +tab_width = 2 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..593e7aa --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,26 @@ + + +## Affected Puppet, Ruby, OS and module versions/distributions + +- Puppet: +- Ruby: +- Distribution: +- Module version: + +## How to reproduce (e.g Puppet code you use) + +## What are you seeing + +## What behaviour did you expect instead + +## Output log + +## Any additional information you'd like to impart diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..342807b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,20 @@ + +#### Pull Request (PR) description + + +#### This Pull Request (PR) fixes the following issues + diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000..f2d08d6 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,6 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +skip-changelog: + - head-branch: ['^release-*', 'release'] diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..f5b5d7a --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,42 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes + +changelog: + exclude: + labels: + - duplicate + - invalid + - modulesync + - question + - skip-changelog + - wont-fix + - wontfix + + categories: + - title: Breaking Changes 🛠 + labels: + - backwards-incompatible + + - title: New Features 🎉 + labels: + - enhancement + + - title: Bug Fixes 🐛 + labels: + - bug + + - title: Documentation Updates 📚 + labels: + - documentation + - docs + + - title: Dependency Updates ⬆️ + labels: + - dependencies + + - title: Other Changes + labels: + - "*" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9680f3d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +name: CI + +# yamllint disable-line rule:truthy +on: + pull_request: {} + push: + branches: + - main + - master + +concurrency: + group: ${{ github.ref_name }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + puppet: + name: Puppet + uses: voxpupuli/gha-puppet/.github/workflows/basic.yml@v4 diff --git a/.github/workflows/create_tag.yml b/.github/workflows/create_tag.yml new file mode 100644 index 0000000..27bffb5 --- /dev/null +++ b/.github/workflows/create_tag.yml @@ -0,0 +1,22 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +name: Create Git tag + +on: + workflow_dispatch: + +permissions: {} + +jobs: + create_tag: + uses: 'voxpupuli/gha-puppet/.github/workflows/create_tag.yml@v4' + with: + allowed_owner: 'ULHPC' + git_name: 'ulhpc-bot' + git_email: '282622861+ULHPC-bot@users.noreply.github.com' + secrets: + # Configure secrets here: + # https://docs.github.com/en/actions/security-guides/encrypted-secrets + ssh_private_key: ${{ secrets.PCCI_SSH_PRIVATE_KEY }} diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000..eacd0b3 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,22 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +name: "Pull Request Labeler" + +# yamllint disable-line rule:truthy +on: + pull_request_target: {} + +permissions: + contents: read + pull-requests: write + +jobs: + labeler: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v5 diff --git a/.github/workflows/prepare_release.yml b/.github/workflows/prepare_release.yml new file mode 100644 index 0000000..3932ce4 --- /dev/null +++ b/.github/workflows/prepare_release.yml @@ -0,0 +1,30 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +name: 'Prepare Release' + +on: + workflow_dispatch: + inputs: + version: + description: 'Module version to be released. Must be a valid semver string without leading v. (1.2.3)' + required: false + +permissions: + contents: write + pull-requests: write + +jobs: + release_prep: + uses: 'voxpupuli/gha-puppet/.github/workflows/prepare_release.yml@v4' + with: + version: ${{ github.event.inputs.version }} + allowed_owner: 'ULHPC' + git_name: 'ulphc-bot' + git_email: '282622861+ULHPC-bot@users.noreply.github.com' + secrets: + # Configure secrets here: + # https://docs.github.com/en/actions/security-guides/encrypted-secrets + github_pat: '${{ secrets.PCCI_PAT_RELEASE_PREP }}' + ssh_private_key: '${{ secrets.PCCI_SSH_PRIVATE_KEY }}' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6f7b711 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +name: Release + +# yamllint disable-line rule:truthy +on: + push: + tags: + # https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#onpushbranchestagsbranches-ignoretags-ignore + # https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#filter-pattern-cheat-sheet + - 'v[0-9]+.[0-9]+.[0-9]+' + +permissions: + contents: write + +jobs: + release: + name: Release + uses: voxpupuli/gha-puppet/.github/workflows/release.yml@v4 + with: + allowed_owner: 'ULHPC' + secrets: + # Configure secrets here: + # https://docs.github.com/en/actions/security-guides/encrypted-secrets + username: ${{ secrets.PUPPET_FORGE_USERNAME }} + api_key: ${{ secrets.PUPPET_FORGE_API_KEY }} diff --git a/.gitignore b/.gitignore index bdfa39c..adea1b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,25 @@ -.DS_Store -.vagrant -/.bundle/* -.falkor* -/pkg/* +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +/pkg/ +/Gemfile.lock +/Gemfile.local +/vendor/ +/.vendor/ +/spec/fixtures/manifests/ +/spec/fixtures/modules/ +/.vagrant/ +/.bundle/ +/.ruby-version +/coverage/ +/log/ +/.idea/ +/.dependencies/ +/.librarian/ +/Puppetfile.lock +*.iml +.*.sw? +/.yardoc/ +/Guardfile +bolt-debug.log +.rerun.json diff --git a/.msync.yml b/.msync.yml new file mode 100644 index 0000000..bfb9bee --- /dev/null +++ b/.msync.yml @@ -0,0 +1,5 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +modulesync_config_version: '10.8.0' diff --git a/.overcommit.yml b/.overcommit.yml new file mode 100644 index 0000000..4ed994c --- /dev/null +++ b/.overcommit.yml @@ -0,0 +1,67 @@ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ +# +# Hooks are only enabled if you take action. +# +# To enable the hooks run: +# +# ``` +# bundle exec overcommit --install +# # ensure .overcommit.yml does not harm to you and then +# bundle exec overcommit --sign +# ``` +# +# (it will manage the .git/hooks directory): +# +# Examples howto skip a test for a commit or push: +# +# ``` +# SKIP=RuboCop git commit +# SKIP=PuppetLint git commit +# SKIP=RakeTask git push +# ``` +# +# Don't invoke overcommit at all: +# +# ``` +# OVERCOMMIT_DISABLE=1 git commit +# ``` +# +# Read more about overcommit: https://github.com/brigade/overcommit +# +# To manage this config yourself in your module add +# +# ``` +# .overcommit.yml: +# unmanaged: true +# ``` +# +# to your modules .sync.yml config +--- +PreCommit: + RuboCop: + enabled: true + description: 'Runs rubocop on modified files only' + command: ['bundle', 'exec', 'rubocop'] + RakeTarget: + enabled: true + description: 'Runs lint on modified files only' + targets: + - 'lint' + command: ['bundle', 'exec', 'rake'] + YamlSyntax: + enabled: true + JsonSyntax: + enabled: true + TrailingWhitespace: + enabled: true + +PrePush: + RakeTarget: + enabled: true + description: 'Run rake targets' + targets: + - 'validate' + - 'test' + - 'rubocop' + command: ['bundle', 'exec', 'rake'] diff --git a/.pmtignore b/.pmtignore index 3843c63..a9d37aa 100644 --- a/.pmtignore +++ b/.pmtignore @@ -1,2 +1,39 @@ -docs/ -site/ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +/docs/ +/pkg/ +/Gemfile +/Gemfile.lock +/Gemfile.local +/vendor/ +/.vendor/ +/spec/ +/Rakefile +/.vagrant/ +/.bundle/ +/.ruby-version +/coverage/ +/log/ +/.idea/ +/.dependencies/ +/.github/ +/.librarian/ +/Puppetfile.lock +/Puppetfile +*.iml +/.editorconfig +/.fixtures.yml +/.gitignore +/.msync.yml +/.overcommit.yml +/.pmtignore +/.rspec +/.rspec_parallel +/.rubocop.yml +/.sync.yml +.*.sw? +/.yardoc/ +/.yardopts +/Dockerfile +/HISTORY.md diff --git a/.puppet-lint.rc b/.puppet-lint.rc new file mode 100644 index 0000000..05d28a2 --- /dev/null +++ b/.puppet-lint.rc @@ -0,0 +1,6 @@ +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +--fail-on-warnings +--no-parameter_documentation-check +--no-parameter_types-check diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..53ac189 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,6 @@ +--- +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +inherit_gem: + voxpupuli-test: rubocop.yml diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 351227f..0000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -3.2.4 diff --git a/Gemfile b/Gemfile index 1878b3f..1283982 100644 --- a/Gemfile +++ b/Gemfile @@ -1,38 +1,28 @@ -# A sample Gemfile -source "https://rubygems.org" +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -gem 'falkorlib', git: 'https://github.com/Falkor/falkorlib.git', ref: 'ed25efb' - -gem 'puppet-syntax', '< 6.0.0' +source ENV['GEM_SOURCE'] || 'https://rubygems.org' group :test do - gem "rake" - gem "puppet", ENV['PUPPET_GEM_VERSION'] || '~> 7' - gem "pdk" - gem "rspec", '< 3.2.0' - gem "rspec-puppet" - gem "puppetlabs_spec_helper" - gem "metadata-json-lint" - gem "rspec-puppet-facts" - gem 'rubocop', '~> 0.51' - gem 'simplecov', '>= 0.11.0' - gem 'simplecov-console' - - #gem 'puppet-lint', '>= 0.3.2' - gem "puppet-lint-absolute_classname-check" - gem "puppet-lint-leading_zero-check" - gem "puppet-lint-trailing_comma-check" - gem "puppet-lint-version_comparison-check" - gem "puppet-lint-classes_and_types_beginning_with_digits-check" - gem "puppet-lint-unquoted_string-check" - gem 'puppet-lint-resource_reference_syntax' - gem 'semantic_puppet' - - gem 'json_pure', '<= 2.0.1' if RUBY_VERSION < '2.0.0' + gem 'voxpupuli-test', '~> 14.0', :require => false + gem 'puppet_metadata', '~> 6.1', :require => false +end + +group :development do + gem 'guard-rake', :require => false + gem 'overcommit', '>= 0.39.1', :require => false end group :system_tests do - gem "beaker", '~> 6.1.0' - gem "beaker-rspec" - gem "beaker-puppet_install_helper" + gem 'voxpupuli-acceptance', '~> 4.4', :require => false +end + +group :release do + gem 'voxpupuli-release', '~> 5.3', :require => false end + +gem 'rake', :require => false + +gem 'openvox', ENV.fetch('OPENVOX_GEM_VERSION', [">= 7", "< 9"]), :require => false, :groups => [:test] + +# vim: syntax=ruby diff --git a/Rakefile b/Rakefile index 6cc925b..b426ea4 100644 --- a/Rakefile +++ b/Rakefile @@ -1,64 +1,36 @@ -############################################################################## -# Rakefile - Configuration file for rake (http://rake.rubyforge.org/) -# Time-stamp: -# -# Copyright (c) 2017 UL HPC Team -# ____ _ __ _ _ -# | _ \ __ _| | _____ / _(_) | ___ -# | |_) / _` | |/ / _ \ |_| | |/ _ \ -# | _ < (_| | < __/ _| | | __/ -# |_| \_\__,_|_|\_\___|_| |_|_|\___| -# -# Use 'rake -T' to list the available actions -# -# Resources: -# * http://www.stuartellis.eu/articles/rake/ -# -# See also https://github.com/garethr/puppet-module-skeleton -############################################################################## -require 'falkorlib' -#require 'puppetlabs_spec_helper/rake_tasks' +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -## placeholder for custom configuration of FalkorLib.config.* -## See https://github.com/Falkor/falkorlib - -# Adapt the versioning aspects -FalkorLib.config.versioning do |c| - c[:type] = 'puppet_module' +begin + require 'voxpupuli/test/rake' +rescue LoadError + # only available if gem group test is installed end -# Adapt the Git flow aspects -FalkorLib.config.gitflow do |c| - c[:branches] = { - :master => 'production', - :develop => 'devel' - } +begin + require 'voxpupuli/acceptance/rake' +rescue LoadError + # only available if gem group acceptance is installed end -require 'falkorlib/tasks/git' -require 'falkorlib/tasks/puppet' - -Rake::Task['puppet:module:build'].clear +begin + require 'voxpupuli/release/rake_tasks' +rescue LoadError + # only available if gem group releases is installed +else + GCGConfig.user = 'ULHPC' + GCGConfig.project = 'puppet-dhcp' +end -namespace :puppet do - namespace :module do - ########### puppet:module:build ########### - desc "Build the puppet module to publish it on the Puppet Forge" - task :build do |t| - info(t.comment).to_s - run %( pdk build --force) - if File.exist?('metadata.json') - metadata = JSON.parse( IO.read( 'metadata.json' ) ) - name = metadata["name"] - version = metadata["version"] - run %( gunzip pkg/#{name}-#{version}.tar.gz) - run %( tar --numeric-owner -rvf pkg/#{name}-#{version}.tar --transform='s,^,#{name}-#{version}/,' metadata.json) - run %( gzip pkg/#{name}-#{version}.tar) - end - end # task build +desc "Run main 'test' task and report merged results to coveralls" +task test_with_coveralls: [:test] do + if Dir.exist?(File.expand_path('../lib', __FILE__)) + require 'coveralls/rake/task' + Coveralls::RakeTask.new + Rake::Task['coveralls:push'].invoke + else + puts 'Skipping reporting to coveralls. Module has no lib dir' end end -############################################################################## -#TOP_SRCDIR = File.expand_path(File.join(File.dirname(__FILE__), ".")) - +# vim: syntax=ruby diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..58c9b66 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# Managed by modulesync - DO NOT EDIT +# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ + +# puppetlabs_spec_helper will set up coverage if the env variable is set. +# We want to do this if lib exists and it hasn't been explicitly set. +ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../lib', __dir__)) + +require 'voxpupuli/test/spec_helper' + +RSpec.configure do |c| + c.facterdb_string_keys = false +end + +add_mocked_facts! + +if File.exist?(File.join(__dir__, 'default_module_facts.yml')) + facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml'))) + facts&.each do |name, value| + add_custom_fact name.to_sym, value + end +end +Dir['./spec/support/spec/**/*.rb'].sort.each { |f| require f } From dd2cd7d5cc42e7b767b34932f87eac8c04b7a7fb Mon Sep 17 00:00:00 2001 From: Hyacinthe Cartiaux Date: Wed, 13 May 2026 15:34:38 +0200 Subject: [PATCH 5/9] docs: use original GPL-3.0 text in the LICENSE file --- LICENSE | 70 ++++++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 13 deletions(-) diff --git a/LICENSE b/LICENSE index a7f5343..f288702 100644 --- a/LICENSE +++ b/LICENSE @@ -1,18 +1,7 @@ -Copyright (C) 2015 UL, HPC, Management, Team - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -627,4 +616,59 @@ above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. \ No newline at end of file +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. From 2d934ccf74bd0bb89f8b67cbb0a12f123373e852 Mon Sep 17 00:00:00 2001 From: Hyacinthe Cartiaux Date: Wed, 13 May 2026 15:42:24 +0200 Subject: [PATCH 6/9] refactor: remove obsoleted files --- .ruby-gemset | 1 - Gemfile.lock | 325 -------------------------- Vagrantfile | 140 ----------- docs/contacts.md | 5 - docs/contributing/index.md | 14 -- docs/contributing/layout.md | 32 --- docs/contributing/setup.md | 52 ----- docs/contributing/versioning.md | 30 --- docs/index.md | 30 --- docs/overview.md | 1 - docs/rtfd.md | 9 - docs/vagrant.md | 79 ------- mkdocs.yml | 12 - tests/init.pp | 24 -- tests/params.pp | 46 ---- tests/vagrant/bootstrap.sh | 229 ------------------ tests/vagrant/config.yaml | 51 ---- tests/vagrant/puppet_modules_setup.rb | 74 ------ 18 files changed, 1154 deletions(-) delete mode 100644 .ruby-gemset delete mode 100644 Gemfile.lock delete mode 100644 Vagrantfile delete mode 100644 docs/contacts.md delete mode 100644 docs/contributing/index.md delete mode 100644 docs/contributing/layout.md delete mode 100644 docs/contributing/setup.md delete mode 100644 docs/contributing/versioning.md delete mode 100644 docs/index.md delete mode 120000 docs/overview.md delete mode 100644 docs/rtfd.md delete mode 100644 docs/vagrant.md delete mode 100644 mkdocs.yml delete mode 100644 tests/init.pp delete mode 100644 tests/params.pp delete mode 100644 tests/vagrant/bootstrap.sh delete mode 100644 tests/vagrant/config.yaml delete mode 100644 tests/vagrant/puppet_modules_setup.rb diff --git a/.ruby-gemset b/.ruby-gemset deleted file mode 100644 index 17cb753..0000000 --- a/.ruby-gemset +++ /dev/null @@ -1 +0,0 @@ -puppet diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 5975724..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,325 +0,0 @@ -GIT - remote: https://github.com/Falkor/falkorlib.git - revision: ed25efbf2d98685bf2fc9d61d0ff2f14ef8e7cc8 - ref: ed25efb - specs: - falkorlib (0.9.1) - activesupport (~> 6.1, >= 6.1.7.5) - artii (~> 2.1, >= 2.1.2) - awesome_print (~> 1.9, >= 1.9.2) - configatron (~> 3.0) - deep_merge (~> 1.0) - diffy (~> 3.4, >= 3.4.2) - facter (~> 4.6.1) - git_remote_branch (~> 0) - json (~> 2.6, >= 2.6.3) - license-generator (~> 0) - logger (~> 1.6) - minigit (~> 0) - rake (~> 13.1) - term-ansicolor (> 1.3) - thor (~> 1.3) - -GEM - remote: https://rubygems.org/ - specs: - activesupport (6.1.7.10) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - zeitwerk (~> 2.3) - addressable (2.9.0) - public_suffix (>= 2.0.2, < 8.0) - ansi (1.5.0) - artii (2.1.2) - ast (2.4.3) - awesome_print (1.9.2) - base64 (0.3.0) - bcrypt_pbkdf (1.1.1) - beaker (6.1.0) - bcrypt_pbkdf (>= 1.0, < 2.0) - beaker-hostgenerator (~> 2.0) - ed25519 (>= 1.2, < 2.0) - hocon (~> 1.0) - in-parallel (>= 0.1, < 2.0) - inifile (~> 3.0) - minitar (~> 0.6) - minitest (~> 5.4) - net-scp (>= 1.2, < 5.0) - net-ssh (~> 7.1) - rexml (~> 3.2, >= 3.2.5) - rsync (~> 1.0.9) - stringify-hash (~> 0.0) - thor (>= 1.0.1, < 2.0) - beaker-hostgenerator (2.24.0) - deep_merge (~> 1.0) - beaker-puppet_install_helper (0.9.4) - beaker (>= 2.0) - beaker-rspec (8.3.0) - beaker (>= 4.0, < 7) - rspec (~> 3.0) - serverspec (~> 2) - specinfra (~> 2) - bigdecimal (3.2.2) - childprocess (5.1.0) - logger (~> 1.5) - concurrent-ruby (1.3.5) - configatron (3.2.0) - cri (2.15.12) - deep_merge (1.2.2) - diff-lcs (1.6.2) - diffy (3.4.4) - docile (1.4.1) - ed25519 (1.4.0) - facter (4.6.1) - hocon (~> 1.3) - thor (>= 1.0.1, < 2.0) - facterdb (3.9.0) - jgrep (~> 1.5, >= 1.5.4) - faraday (2.14.1) - faraday-net_http (>= 2.0, < 3.5) - json - logger - faraday-follow_redirects (0.3.0) - faraday (>= 1, < 3) - faraday-net_http (3.4.2) - net-http (~> 0.5) - fast_gettext (2.4.0) - prime - ffi (1.17.2-x86_64-linux-gnu) - forwardable (1.3.3) - git_remote_branch (0.3.8) - hiera (3.12.0) - hitimes (2.0.0) - hocon (1.4.0) - i18n (1.14.7) - concurrent-ruby (~> 1.0) - in-parallel (1.0.1) - inifile (3.0.0) - jgrep (1.5.4) - json (2.19.2) - json-schema (5.2.1) - addressable (~> 2.8) - bigdecimal (~> 3.1) - license-generator (0.4.1) - thor - locale (2.1.4) - logger (1.7.0) - metadata-json-lint (4.2.1) - json-schema (>= 2.8, < 6.0) - semantic_puppet (~> 1.0) - spdx-licenses (~> 1.0) - minigit (0.0.4) - minitar (0.12.1) - minitest (5.25.5) - mocha (2.7.1) - ruby2_keywords (>= 0.0.5) - multi_json (1.17.0) - net-http (0.9.1) - uri (>= 0.11.1) - net-scp (4.1.0) - net-ssh (>= 2.6.5, < 8.0.0) - net-ssh (7.3.0) - net-telnet (0.2.0) - parallel (1.27.0) - parser (3.3.9.0) - ast (~> 2.4.1) - racc - pastel (0.8.0) - tty-color (~> 0.5) - pathspec (1.1.3) - pdk (3.4.0) - bundler (>= 2.1.0, < 3.0.0) - childprocess (~> 5.0) - cri (~> 2.15.11) - deep_merge (~> 1.2.2) - diff-lcs (>= 1.5.0) - ffi (>= 1.15.5, < 2.0.0) - hitimes (= 2.0.0) - json-schema (~> 5.0) - minitar (~> 0.8) - pathspec (~> 1.1) - puppet-modulebuilder (~> 1.0) - puppet_forge (~> 5.0) - tty-prompt (~> 0.23) - tty-spinner (~> 0.9) - tty-which (~> 0.5) - prime (0.1.4) - forwardable - singleton - prism (1.4.0) - public_suffix (7.0.5) - puppet (7.34.0) - concurrent-ruby (~> 1.0) - deep_merge (~> 1.0) - facter (> 2.0.1, < 5) - fast_gettext (>= 1.1, < 3) - hiera (>= 3.2.1, < 4) - locale (~> 2.1) - multi_json (~> 1.10) - puppet-resource_api (~> 1.5) - scanf (~> 1.0) - semantic_puppet (~> 1.0) - puppet-lint (2.5.2) - puppet-lint-absolute_classname-check (3.1.0) - puppet-lint (>= 1.0, < 4) - puppet-lint-classes_and_types_beginning_with_digits-check (1.0.0) - puppet-lint (>= 1.0, < 3.0) - puppet-lint-leading_zero-check (1.1.0) - puppet-lint (>= 1.0, < 4.0) - puppet-lint-resource_reference_syntax (1.2.0) - puppet-lint (>= 1.0, < 4) - puppet-lint-trailing_comma-check (1.0.0) - puppet-lint (>= 1.0, < 4) - puppet-lint-unquoted_string-check (2.2.0) - puppet-lint (>= 2.1, < 4) - puppet-lint-version_comparison-check (1.1.0) - puppet-lint (>= 1.0, < 4) - puppet-modulebuilder (1.1.0) - minitar (~> 0.9) - pathspec (>= 0.2.1, < 3.0.0) - puppet-resource_api (1.9.0) - hocon (>= 1.0) - puppet-syntax (5.0.0) - puppet (>= 7, < 9) - rake (~> 13.1) - puppet_forge (5.0.4) - faraday (~> 2.0) - faraday-follow_redirects (~> 0.3.0) - minitar (< 1.0.0) - semantic_puppet (~> 1.0) - puppetlabs_spec_helper (1.1.1) - mocha - puppet-lint - puppet-syntax - rake - rspec-puppet - racc (1.8.1) - rainbow (3.1.1) - rake (13.3.0) - regexp_parser (2.11.0) - rexml (3.4.2) - rspec (3.1.0) - rspec-core (~> 3.1.0) - rspec-expectations (~> 3.1.0) - rspec-mocks (~> 3.1.0) - rspec-core (3.1.7) - rspec-support (~> 3.1.0) - rspec-expectations (3.1.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.1.0) - rspec-its (1.3.1) - rspec-core (>= 3.0.0) - rspec-expectations (>= 3.0.0) - rspec-mocks (3.1.3) - rspec-support (~> 3.1.0) - rspec-puppet (5.0.0) - rspec (~> 3.0) - rspec-puppet-facts (5.4.0) - deep_merge (~> 1.2) - facter (< 5) - facterdb (~> 3.1) - rspec-support (3.1.2) - rsync (1.0.9) - rubocop (0.93.1) - parallel (~> 1.10) - parser (>= 2.7.1.5) - rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8) - rexml - rubocop-ast (>= 0.6.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (1.46.0) - parser (>= 3.3.7.2) - prism (~> 1.4) - ruby-progressbar (1.13.0) - ruby2_keywords (0.0.5) - scanf (1.0.0) - semantic_puppet (1.1.1) - serverspec (2.43.0) - multi_json - rspec (~> 3.0) - rspec-its - specinfra (~> 2.72) - sfl (2.3) - simplecov (0.22.0) - docile (~> 1.1) - simplecov-html (~> 0.11) - simplecov_json_formatter (~> 0.1) - simplecov-console (0.9.4) - ansi - simplecov - terminal-table - simplecov-html (0.13.2) - simplecov_json_formatter (0.1.4) - singleton (0.3.0) - spdx-licenses (1.3.0) - specinfra (2.94.1) - base64 - net-scp - net-ssh (>= 2.7) - net-telnet - sfl - stringify-hash (0.0.2) - sync (0.5.0) - term-ansicolor (1.11.2) - tins (~> 1.0) - terminal-table (4.0.0) - unicode-display_width (>= 1.1.1, < 4) - thor (1.4.0) - tins (1.39.1) - bigdecimal - sync - tty-color (0.6.0) - tty-cursor (0.7.1) - tty-prompt (0.23.1) - pastel (~> 0.8) - tty-reader (~> 0.8) - tty-reader (0.9.0) - tty-cursor (~> 0.7) - tty-screen (~> 0.8) - wisper (~> 2.0) - tty-screen (0.8.2) - tty-spinner (0.9.3) - tty-cursor (~> 0.7) - tty-which (0.5.0) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - unicode-display_width (1.8.0) - uri (1.1.1) - wisper (2.0.1) - zeitwerk (2.7.3) - -PLATFORMS - x86_64-linux - -DEPENDENCIES - beaker (~> 6.1.0) - beaker-puppet_install_helper - beaker-rspec - falkorlib! - metadata-json-lint - pdk - puppet (~> 7) - puppet-lint-absolute_classname-check - puppet-lint-classes_and_types_beginning_with_digits-check - puppet-lint-leading_zero-check - puppet-lint-resource_reference_syntax - puppet-lint-trailing_comma-check - puppet-lint-unquoted_string-check - puppet-lint-version_comparison-check - puppet-syntax (< 6.0.0) - puppetlabs_spec_helper - rake - rspec (< 3.2.0) - rspec-puppet - rspec-puppet-facts - rubocop (~> 0.51) - semantic_puppet - simplecov (>= 0.11.0) - simplecov-console - -BUNDLED WITH - 2.4.19 diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index 0981c9b..0000000 --- a/Vagrantfile +++ /dev/null @@ -1,140 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : -# Time-stamp: -########################################################################################### -# __ __ _ __ _ _ -# \ \ / /_ _ __ _ _ __ __ _ _ __ | |_ / _(_) | ___ -# \ \ / / _` |/ _` | '__/ _` | '_ \| __| |_| | |/ _ \ -# \ V / (_| | (_| | | | (_| | | | | |_| _| | | __/ -# \_/ \__,_|\__, |_| \__,_|_| |_|\__|_| |_|_|\___| -# |___/ -########################################################################################### -require 'yaml' -require 'ipaddr' -require 'deep_merge' - -# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! -VAGRANTFILE_API_VERSION = "2" -TOP_SRCDIR = File.expand_path File.dirname(__FILE__) -TOP_VAGRANT_TESTDIR = File.join(TOP_SRCDIR, 'tests', 'vagrant') -config_file = File.join(TOP_VAGRANT_TESTDIR, 'config.yaml') - -###### Expected Vagrant plugins detection ###### -# For more information on the below plugins: -# - https://github.com/oscar-stack/vagrant-hosts -# - https://github.com/dotless-de/vagrant-vbguest -# - https://github.com/emyl/vagrant-triggers -# - https://github.com/fgrehm/vagrant-cachier -# Terminal-table is a nice ruby gem for automatically print tables with nice layout -### -[ 'vagrant-hosts', 'vagrant-vbguest', 'vagrant-triggers', 'vagrant-cachier', 'terminal-table' ].each do |plugin| - abort "Install the '#{plugin}' plugin with 'vagrant plugin install #{plugin}'" unless Vagrant.has_plugin?("#{plugin}") -end -require 'terminal-table' - -### Default settings ### -DEFAULT_SETTINGS = { - :defaults => { - :os => :centos7, - :ram => 512, - :vcpus => 4, - :vbguest_auto_update => true, - }, - # Default domain settings - :network => { - :domain => 'vagrant.dev', - :range => '10.10.1.0/24', - :ip_offset => 10, - }, - # Default Boxes - :boxes => { - :centos7 => 'centos/7', - :debian8 => 'debian/contrib-jessie64', - :ubuntu14 => 'ubuntu/trusty64' - }, - :vms => { - 'default' => { } - }, -} - -# List of default provisioning scripts -DEFAULT_PROVISIONING_SCRIPTS = [ - "tests/vagrant/bootstrap.sh", - "tests/vagrant/puppet_modules_setup.rb" -] - -# Load the settings (eventually overwritten using values from the yaml file 'config.yaml') -settings = DEFAULT_SETTINGS.clone -if File.exist?(config_file) - config = YAML::load_file config_file - settings.deep_merge!( config ) if config -end -abort "Undefined settings" if settings.nil? - - -############################################################ -Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - defaults = settings[:defaults] - network = settings[:network] - - ### Common configs shared by all VMs ### - # Cache plugin -- Supports local cache, so you don't wast bandwitdh - # vagrant plugin install vagrant-cachier # see https://github.com/fgrehm/vagrant-cachier - config.cache.auto_detect = true if Vagrant.has_plugin?("vagrant-cachier") - - # check if VirtualBox Guest Additions are up to date - if Vagrant.has_plugin?("vagrant-vbguest") - # set auto_update to false, if you do NOT want to check the correct - # additions version when booting these boxes - config.vbguest.auto_update = defaults[:vbguest_auto_update] - end - - # Shell provisioner, to setup minimal conditions for Puppet provisioning - DEFAULT_PROVISIONING_SCRIPTS.each do |script| - config.vm.provision "shell", path: "#{script}", keep_color: true - end - config.vm.synced_folder ".", "/vagrant", type: "virtualbox" - - # network settings - ipaddr = IPAddr.new network[:range] - ip_range = ipaddr.to_range.to_a - - # cosmetics for the post-up message - __table = { - :title => "Puppet Testing infrastructure deployed on Vagrant", - :headings => [ 'Name', 'Hostname', 'OS', 'vCPU/RAM', 'Description', 'IP' ], - :rows => [], - } - #__________________________________ - settings[:vms].each do |name, node| - boxname = defaults[:os].to_s.downcase.gsub(/([^\d]+)(\d+)/, '\\1-\\2') - name = boxname if name == 'default' - hostname = node[:hostname] ? node[:hostname] : name - domain = network[:domain] - fqdn = "#{hostname}.#{domain}" - os = node[:os] ? node[:os].to_sym : defaults[:os].to_sym - ram = node[:ram] ? node[:ram] : defaults[:ram] - vcpus = node[:vcpus] ? node[:vcpus] : defaults[:vcpus] - desc = node[:desc] ? node[:desc] : 'n/a' - - abort "Non-existing box OS '#{os}' for the VM '#{name}'" if settings[:boxes][os.to_sym].nil? - abort "Empty IP address range" if ip_range.empty? - ip = ip_range[ network[:ip_offset].to_i ].to_s - - config.vm.define "#{name}" do |c| - c.vm.box = settings[:boxes][os.to_sym] - c.vm.hostname = "#{fqdn}" - c.vm.network :private_network, :ip => ip - c.vm.provision :hosts, :sync_hosts => true - c.vm.provider "virtualbox" do |v| - v.customize [ 'modifyvm', :id, '--name', hostname, '--memory', ram.to_s ] - v.customize [ 'modifyvm', :id, '--cpus', vcpus.to_s ] if vcpus.to_i > 1 - end - __table[:rows] << [ name, fqdn, os.to_sym, "#{vcpus}/#{ram}", desc, ip] - end - end - - config.trigger.after :up do - puts Terminal::Table.new __table - end -end diff --git a/docs/contacts.md b/docs/contacts.md deleted file mode 100644 index 7791387..0000000 --- a/docs/contacts.md +++ /dev/null @@ -1,5 +0,0 @@ -This Puppet Module has been implemented in the context of the [UL HPC](http://hpc.uni.lu) Platform of the [University of Luxembourg](http://www.uni.lu). -More precisely, the [UL HPC Team](https://hpc.uni.lu/about/team.html#system-administrators) took care of the development for this module. - -You can submit bug / issues / feature request using the [ULHPC/dhcp Puppet Module Tracker](https://github.com/ULHPC/puppet-dhcp/issues). -Alternatively, you can contact them on the following email address: `hpc-sysadmins@uni.lu` diff --git a/docs/contributing/index.md b/docs/contributing/index.md deleted file mode 100644 index 5bbcaf5..0000000 --- a/docs/contributing/index.md +++ /dev/null @@ -1,14 +0,0 @@ -This project is released under the terms of the [Gpl-3.0 Licence](LICENSE). -So you are more than welcome to contribute to its development as follows: - -1. Fork it -2. Create your feature branch (`rake git:feature:start[]`) -3. Commit your changes (`git commit -am 'Added some feature'`) -4. Push to the branch (`git flow feature publish `) -5. Create new Pull Request - -This assumes that you have understood the [directory tree structure](layout.md) of this Puppet module. - -There is also a number of pre-requisite programs / framework you shall install to be able to correctly contribute to this Puppet module. This is detailed in the [Repository Setup and Developments](setup.md) page. - -Finally, you shall be aware of the way the [semantic versioning](versioning.md) procedure of this Puppet module are handled. diff --git a/docs/contributing/layout.md b/docs/contributing/layout.md deleted file mode 100644 index 34a8bee..0000000 --- a/docs/contributing/layout.md +++ /dev/null @@ -1,32 +0,0 @@ -The directory hosting the implementation of this puppet module is organized as follows: - -``` -.gitignore # Git ignore file -.ruby-{version,gemset} # [RVM](https://rvm.io/) configuration -.vagrant_init.rb # Vagrant provisionner to test this module -├── Gemfile[.lock] # [Bundler](http://bundler.io/) configuration -├── LICENSE # Licence file -├── README.md # This file -├── Rakefile # Definition of the [rake](https://github.com/jimweirich/rake) tasks -├── Vagrantfile # Pilot Vagrant to test this module -├── docs/ # [Read the Docs](readthedocs.org) main directory -├── files/ # (eventually) Contains static files, which managed nodes can download -├── lib/ # (eventually) Custom facts/type/provider definitions -├── manifests/ -│   ├── init.pp # Main manifests file which defines the sudo class -│   ├── common/ -│   │   ├── debian.pp # Specific Debian setup for the main class -│   │   └── redhat.pp # Specific Redhat setup for the main class -│   ├── common.pp # Common class setup for all OS -│   ├── ... # Implementation of the other dhcp::* classes / definitions -│   └── params.pp # Class parameters -├── metadata.json # Puppet module configuration file -- See http://tinyurl.com/puppet-metadata-json -├── mkdocs.yml # [Read the Docs](readthedocs.org) configuration -├── pkg/ # Hold build packages to be published on the [Puppet forge](https://forge.puppetlabs.com/ULHPC/dhcp) -├── spec/ # (eventually) [Rspec](https://www.relishapp.com/rspec/) tests -├── templates/ # (eventually) Module ERB template files -└── tests/ # Tests cases for the module usage -``` - -Globally, this module follows the [official PuppetLabs guidelines for the predictable directory tree structure of Puppet modules](http://docs.puppetlabs.com/puppet/latest/reference/modules_fundamentals.html#module-layout). - diff --git a/docs/contributing/setup.md b/docs/contributing/setup.md deleted file mode 100644 index 1a2a1b4..0000000 --- a/docs/contributing/setup.md +++ /dev/null @@ -1,52 +0,0 @@ -There is a number of pre-requisite programs / framework you shall install to be able to correctly contribute to this Puppet module. - -### Git Branching Model - -The Git branching model for this repository follows the guidelines of [gitflow](http://nvie.com/posts/a-successful-git-branching-model/). -In particular, the central repository holds two main branches with an infinite lifetime: - -* `production`: the branch holding tags of the successive releases of this tutorial -* `devel`: the main branch where the sources are in a state with the latest delivered development changes for the next release. This is the *default* branch you get when you clone the repository, and the one on which developments will take places. - -You should therefore install [git-flow](https://github.com/nvie/gitflow), and probably also its associated [bash completion](https://github.com/bobthecow/git-flow-completion). - -### Ruby, [RVM](https://rvm.io/) and [Bundler](http://bundler.io/) - -The various operations that can be conducted from this repository are piloted -from a `Rakefile` and assumes you have a running Ruby installation. - -The bootstrapping of your repository is based on [RVM](https://rvm.io/), **thus -ensure this tools are installed on your system** -- see -[installation notes](https://rvm.io/rvm/install). - -The ruby stuff part of this repository corresponds to the following files: - -* `.ruby-{version,gemset}`: [RVM](https://rvm.io/) configuration, use the name of the - project as [gemset](https://rvm.io/gemsets) name -* `Gemfile[.lock]`: used by `[bundle](http://bundler.io/)` - -### Repository Setup - -Then, to make your local copy of the repository ready to use the [git-flow](https://github.com/nvie/gitflow) workflow and the local [RVM](https://rvm.io/) setup, you have to run the following commands once you cloned it for the first time: - - $> gem install bundler # assuming it is not yet available - $> bundle install - $> rake -T # To list the available tasks - $> rake setup - -You probably wants to activate the bash-completion for rake tasks. -I personnaly use the one provided [here](https://github.com/ai/rake-completion) - -Also, some of the tasks are hidden. Run `rake -T -A` to list all of them. - -### RSpec tests - -A set of unitary tests are defined to validate the different function of my library using [Rspec](http://rspec.info/) - -You can run these tests by issuing: - - $> rake rspec # NOT YET IMPLEMENTED - -By conventions, you will find all the currently implemented tests in the `spec/` directory, in files having the `_spec.rb` suffix. This is expected from the `rspec` task of the `Rakefile`. - -**Important** Kindly stick to this convention, and feature tests for all definitions/classes/modules you might want to add. diff --git a/docs/contributing/versioning.md b/docs/contributing/versioning.md deleted file mode 100644 index b5d893c..0000000 --- a/docs/contributing/versioning.md +++ /dev/null @@ -1,30 +0,0 @@ -The operation consisting of releasing a new version of this repository is -automated by a set of tasks within the `Rakefile`. - -In this context, a version number have the following format: - - .. - -where: - -* `< major >` corresponds to the major version number -* `< minor >` corresponds to the minor version number -* `< patch >` corresponds to the patching version number - -Example: `1.2.0` - -The current version number is stored in the file `metadata.json`. -For more information on the version, run: - - $> rake version:info - -If a new version number such be bumped, you simply have to run: - - $> rake version:bump:{major,minor,patch} - -This will start the release process for you using `git-flow`. -Then, to make the release effective, just run: - - $> rake version:release - -This will finalize the release using `git-flow`, create the appropriate tag and merge all things the way they should be. diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index 49eb6d5..0000000 --- a/docs/index.md +++ /dev/null @@ -1,30 +0,0 @@ --*- mode: markdown; mode: visual-line; -*- - -# ULHPC/dhcp Puppet Module - -[![Puppet Forge](http://img.shields.io/puppetforge/v/ULHPC/dhcp.svg)](https://forge.puppetlabs.com/ULHPC/dhcp) -[![License](http://img.shields.io/:license-GPL3.0-blue.svg)](LICENSE) -![Supported Platforms](http://img.shields.io/badge/platform-debian-lightgrey.svg) -[![Documentation Status](https://readthedocs.org/projects/ulhpc-puppet-dhcp/badge/?version=latest)](https://readthedocs.org/projects/ulhpc-puppet-dhcp/?badge=latest) -[![By ULHPC](https://img.shields.io/badge/by-ULHPC-blue.svg)](http://hpc.uni.lu) - - Copyright (c) 2020 UL HPC DevOps Team - -| [Project Page](https://github.com/ULHPC/puppet-dhcp) | [Documentation](http://ulhpc-puppet-dhcp.readthedocs.org/en/latest/) | [Issues](https://github.com/ULHPC/puppet-dhcp/issues) | - - ------------ -The [ULHPC/dhcp](https://github.com/ULHPC/puppet-dhcp) puppet module has been designed to configure dhcp client and server - -This is the main page of the documentation for this Puppet module, which is hosted and managed by [Read the Docs](http://ulhpc-dhcp.readthedocs.org/en/latest/). -It proposes to detail the following elements: - -* An [Overview](overview.md) of the module is proposed, describing the puppet classes and/or definitions it implements. - - you might also wish to check the `tests/` directory for sample test cases -* How to [test this module with Vagrant](vagrant.md) -* How to [contribute](contributing/index.md) to this puppet module development. In particular, we detail: - - the [directory tree structure](contributing/layout.md) - - the steps to follow to [setup this repository](contributing/setup.md) - - information as regard the [semantic versioning](contributing/versioning.md) of this Puppet module. - - Apart form the directory layout, we will cover various configuration aspects ([git-flow](https://github.com/nvie/gitflow), [RVM](https://rvm.io/), [Bundler](http://bundler.io/) etc.) -* Details on the [Read the Docs](http://ulhpc-puppet-dhcp.readthedocs.org/en/latest/) management. diff --git a/docs/overview.md b/docs/overview.md deleted file mode 120000 index 32d46ee..0000000 --- a/docs/overview.md +++ /dev/null @@ -1 +0,0 @@ -../README.md \ No newline at end of file diff --git a/docs/rtfd.md b/docs/rtfd.md deleted file mode 100644 index dc9e961..0000000 --- a/docs/rtfd.md +++ /dev/null @@ -1,9 +0,0 @@ -The documentation for this puppet module is handled by [Read the Docs](https://readthedocs.org/), a web service dedicated to documentation management for the open source community. - -* [Reference documentation](https://docs.readthedocs.org/en/latest/) - -You might wish to generate locally the docs: - -* Install [`mkdocs`](http://www.mkdocs.org/#installation) -* Preview your documentation from the project root by running `mkdocs serve` and visite with your favorite browser the URL `http://localhost:8000` -* build the full documentation locally by running `mkdocs build` diff --git a/docs/vagrant.md b/docs/vagrant.md deleted file mode 100644 index f40e206..0000000 --- a/docs/vagrant.md +++ /dev/null @@ -1,79 +0,0 @@ --*- mode: markdown; mode: visual-line; -*- - -# Dhcp Puppet Module Tests with Vagrant - -The best way to test this module in a non-intrusive way is to rely on [Vagrant](http://www.vagrantup.com/). -[Vagrant](http://vagrantup.com/) uses [Oracle's VirtualBox](http://www.virtualbox.org/) -to build configurable, lightweight, and portable virtual machines dynamically. - -* [Reference installation notes](http://docs.vagrantup.com/v2/installation/) -- assuming you have installed [Oracle's VirtualBox](http://www.virtualbox.org/) -* [installation notes on Mac OS](http://sourabhbajaj.com/mac-setup/Vagrant/README.html) using [Homebrew](http://brew.sh/) and [Cask](http://sourabhbajaj.com/mac-setup/Homebrew/Cask.html) - -The `Vagrantfile` at the root of the repository pilot the provisioning a vagrant boxes. -It can run any OS you set in `tests/vagrant/config.yaml` as follows: - -```yaml -:vms: - 'default': - :os: :debian8 -``` - -You can list the available vagrant box as follows: - -```bash -$> vagrant status -Current machine states: - -centos-7 running (virtualbox) - -The VM is running. To stop this VM, you can run `vagrant halt` to -shut it down forcefully, or you can run `vagrant suspend` to simply -suspend the virtual machine. In either case, to restart it again, -simply run `vagrant up`. -``` - -You can boot the VM and provision it (using the scripts under `tests/vagrant/`) by running: - -```bash -$> vagrant up -``` - -Then you can ssh into the machine afterwards: - -```bash -$> vagrant ssh -``` - -When you run `vagrant up ` to boot the VM, the provisioning scripts are responsible for: - -| Script | Description | -|---------------------------|-------------------------------------------------| -| `bootstrap.sh` | Install puppet 4 and defaults packages and gems | -| `puppet_modules_setup.rb` | pre-install the necessary puppet modules | - -More precisely, the `tests/vagrant/puppet_modules_setup.rb` script. -This script is responsible for two main tasks: - -1. pre-install the puppet modules listed as dependencies in `metadata.json` -2. make the appropriate symbolic link in the puppet module directory (to `/vagrant`) to ensure you can directly make changes and correct your own module transparently within the box. - -So you can test the manifests of the `tests/` directory within the VM: - - $> vagrant ssh [] - [...] - (vagrant)$> sudo puppet apply -t /vagrant/tests/init.pp - -From now on, you can test (with --noop) the other manifests. - -Run `vagrant halt` (or `vagrant destroy`) to stop (or kill) the VM once you've finished to play with it. - -_Note_: The `Vagrantfile` at the root of this repository might evolve over the time with new boxes. To automatically get the last version available: - -1. Upgrade the [`falkorlib`](https://rubygems.org/gems/falkorlib) gem - - $> bundle update falkorlib - $> git commit -s -m "Upgrade falkorlib to the latest version" Gemfile.lock - -2. update the `Vagrantfile` to the last version by issuing: - - $> rake templates:upgrade:vagrant diff --git a/mkdocs.yml b/mkdocs.yml deleted file mode 100644 index 4a21c68..0000000 --- a/mkdocs.yml +++ /dev/null @@ -1,12 +0,0 @@ -site_name: ULHPC/dhcp Puppet Module -pages: -- ['index.md', 'Home'] -- ['overview.md', 'Overview'] -- ['vagrant.md', 'Tests with Vagrant'] -- ['contributing/index.md', 'Contributing', 'Overview'] -- ['contributing/layout.md', 'Contributing', 'Directory Layout'] -- ['contributing/setup.md', 'Contributing', 'Repository Setup and Developments'] -- ['contributing/versioning.md', 'Contributing', 'Module Versioning'] -- ['rtfd.md', 'Documentation', 'RTFD'] -- ['contacts.md', 'Contacts'] -theme: readthedocs diff --git a/tests/init.pp b/tests/init.pp deleted file mode 100644 index 1f33ebd..0000000 --- a/tests/init.pp +++ /dev/null @@ -1,24 +0,0 @@ -# The baseline for module testing used by Puppet Labs is that each manifest -# should have a corresponding test manifest that declares that class or defined -# type. -# -# Tests are then run by using puppet apply --noop (to check for compilation -# errors and view a log of events) or by fully applying the test in a virtual -# environment (to compare the resulting system state to the desired state). -# -# Learn more about module testing here: -# http://docs.puppetlabs.com/guides/tests_smoke.html -# -# -# -# You can execute this manifest as follows in your vagrant box: -# -# sudo puppet apply -t /vagrant/tests/init.pp -# - -node default { - class { 'dhcp::server': - ensure => present, - source => 'puppet:///modules/dhcp/dhcpd.conf', - } -} diff --git a/tests/params.pp b/tests/params.pp deleted file mode 100644 index cc1b513..0000000 --- a/tests/params.pp +++ /dev/null @@ -1,46 +0,0 @@ -# File:: params.pp -# Author:: UL HPC Management Team (hpc-sysadmins@uni.lu) -# Copyright:: Copyright (c) 2015 UL HPC Management Team -# License:: Gpl-3.0 -# -# ------------------------------------------------------------------------------ -# You need the 'future' parser to be able to execute this manifest (that's -# required for the each loop below). -# -# Thus execute this manifest in your vagrant box as follows: -# -# sudo puppet apply -t --parser future /vagrant/tests/params.pp -# -# - -include 'dhcp::params' - -$names = ['ensure', 'protocol', 'port', 'client_package', 'server_package', - 'servicename', 'processname', 'hasstatus', 'hasrestart', 'configfile', - 'configfile_owner', 'configfile_group', 'configfile_mode', - 'configdir', 'configdir_mode', 'configdir_owner', 'configdir_group', - 'initconfigfile'] - -notice("dhcp::params::ensure = ${dhcp::params::ensure}") -notice("dhcp::params::protocol = ${dhcp::params::protocol}") -notice("dhcp::params::port = ${dhcp::params::port}") -notice("dhcp::params::client_package = ${dhcp::params::client_package}") -notice("dhcp::params::server_package = ${dhcp::params::server_package}") -notice("dhcp::params::servicename = ${dhcp::params::servicename}") -notice("dhcp::params::processname = ${dhcp::params::processname}") -notice("dhcp::params::hasstatus = ${dhcp::params::hasstatus}") -notice("dhcp::params::hasrestart = ${dhcp::params::hasrestart}") -notice("dhcp::params::configfile = ${dhcp::params::configfile}") -notice("dhcp::params::configfile_owner = ${dhcp::params::configfile_owner}") -notice("dhcp::params::configfile_group = ${dhcp::params::configfile_group}") -notice("dhcp::params::configfile_mode = ${dhcp::params::configfile_mode}") -notice("dhcp::params::configdir = ${dhcp::params::configdir}") -notice("dhcp::params::configdir_mode = ${dhcp::params::configdir_mode}") -notice("dhcp::params::configdir_owner = ${dhcp::params::configdir_owner}") -notice("dhcp::params::configdir_group = ${dhcp::params::configdir_group}") -notice("dhcp::params::initconfigfile = ${dhcp::params::initconfigfile}") - -#each($names) |$v| { -# $var = "dhcp::params::${v}" -# notice("${var} = ", inline_template('<%= scope.lookupvar(@var) %>')) -#} diff --git a/tests/vagrant/bootstrap.sh b/tests/vagrant/bootstrap.sh deleted file mode 100644 index 3e391b0..0000000 --- a/tests/vagrant/bootstrap.sh +++ /dev/null @@ -1,229 +0,0 @@ -#!/usr/bin/env bash -# Time-stamp: -########################################################################################### -# __ __ _ ____ _ _ -# \ \ / /_ _ __ _ _ __ __ _ _ __ | |_ | __ ) ___ ___ | |_ ___| |_ _ __ __ _ _ __ -# \ \ / / _` |/ _` | '__/ _` | '_ \| __| | _ \ / _ \ / _ \| __/ __| __| '__/ _` | '_ \ -# \ V / (_| | (_| | | | (_| | | | | |_ | |_) | (_) | (_) | |_\__ \ |_| | | (_| | |_) | -# \_/ \__,_|\__, |_| \__,_|_| |_|\__| |____/ \___/ \___/ \__|___/\__|_| \__,_| .__/ -# |___/ |_| -# Copyright (c) 2017 UL HPC Team -########################################################################################### -# ULHPC (prefered) way to see a Vagrant box configured. -# - -SETCOLOR_NORMAL=$(tput sgr0) -SETCOLOR_TITLE=$(tput setaf 6) -SETCOLOR_SUBTITLE=$(tput setaf 14) -SETCOLOR_RED=$(tput setaf 1) -SETCOLOR_BOLD=$(tput setaf 15) - -### Local variables -STARTDIR="$(pwd)" -SCRIPTFILENAME=$(basename $0) -SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -MOTD="/etc/motd" -DOTFILES_DIR='/etc/dotfiles.d' -DOTFILES_URL='https://github.com/ULHPC/dotfiles.git' -SUPPORT_MAIL='hpc-sysadmins@uni.lu' -EXTRA_PACKAGES= - -# List of default packages to install -COMMON_DEFAULT_PACKAGES="ruby wget figlet git screen bash-completion rsync vim" - -GEMS="librarian-puppet falkorlib" - -###### -# Print information in the following form: '[$2] $1' ($2=INFO if not submitted) -# usage: info text [title] -## -info () { - echo - echo "${SETCOLOR_BOLD}###${SETCOLOR_NORMAL} ${SETCOLOR_TITLE}${1}${SETCOLOR_NORMAL} ${SETCOLOR_BOLD}###${SETCOLOR_NORMAL}" -} -error() { - echo - echo "${SETCOLOR_RED}*** ERROR *** $*${SETCOLOR_NORMAL}" - exit 1 -} - -print_usage() { - cat </dev/null - - info "Installing default packages" - yum install -y epel-release - yum install -y ${COMMON_DEFAULT_PACKAGES} ruby-devel bind-utils ${EXTRA_PACKAGES} >/dev/null - - info "Uninstalling (eventually) existing Puppet installation" - yum erase -y puppet puppetlabs-release >/dev/null - - info "Adding repo for Puppet 4" - rpm -ivh https://yum.puppetlabs.com/puppetlabs-release-pc1-el-$1.noarch.rpm - - sleep 1 - info "Installing Puppet and its dependencies" - yum install -y puppet-agent >/dev/null -} - -setup_apt() { - case $1 in - 3*) codename=cumulus ;; - 6) codename=squeeze ;; - 7) codename=wheezy ;; - 8) codename=jessie ;; - 9) codename=stretch ;; - 12.04) codename=precise ;; - 14.04) codename=trusty ;; - 16.04) codename=xenial ;; - *) echo "Release not supported" ;; - esac - - info "Adding repo for Puppet 4" - wget -q "http://apt.puppetlabs.com/puppetlabs-release-pc1-${codename}.deb" >/dev/null - dpkg -i "puppetlabs-release-pc1-${codename}.deb" >/dev/null - - info "Running apt-get update" - apt-get update >/dev/null 2>&1 - - info "Installing default packages" - apt-get install -y ${COMMON_DEFAULT_PACKAGES} git-core rubygems ${EXTRA_PACKAGES} >/dev/null - - info "Installing Puppet and its dependencies" - apt-get install puppet-agent -y >/dev/null - apt-get install apt-transport-https -y >/dev/null -} - -setup_linux() { - ARCH=$(uname -m | sed 's/x86_//;s/i[3-6]86/32/') - if [ -f /etc/redhat-release ]; then - OS=$(cat /etc/redhat-release | cut -d ' ' -f 1) - majver=$(cat /etc/redhat-release | sed 's/[A-Za-z]*//g' | sed 's/ //g' | cut -d '.' -f 1) - elif [ -f /etc/SuSE-release ]; then - OS=sles - majver=$(cat /etc/SuSE-release | grep VERSION | cut -d '=' -f 2 | tr -d '[:space:]') - elif [ -f /etc/os-release ]; then - . /etc/os-release - OS=$ID - majver=$VERSION_ID - elif [ -f /etc/debian_version ]; then - OS=Debian - majver=$(cat /etc/debian_version | cut -d '.' -f 1) - elif [ -f /etc/lsb-release ]; then - . /etc/lsb-release - OS=$DISTRIB_ID - majver=$DISTRIB_RELEASE - elif [ -f /etc/os-release ]; then - . /etc/os-release - OS=$ID - majver=$VERSION_ID - else - OS=$(uname -s) - majver=$(uname -r) - fi - distro=$(echo $OS | tr '[:upper:]' '[:lower:]') - info "Detected Linux distro: ${distro} version ${majver} on arch ${ARCH}" - case "$distro" in - debian|ubuntu) setup_apt $majver ;; - redhat|fedora|centos|scientific|amazon) setup_redhat $majver ;; - *) echo "Not supported distro: $distro"; exit 1;; - esac - -} - -setup_dotfiles () { - if [ ! -d "${DOTFILES_DIR}" ]; then - info "cloning ULHPC/dotfiles repository in '/etc/dotfiles.d" - git clone ${DOTFILES_URL} ${DOTFILES_DIR} - fi - # Correct __git_ps1 - local src_git_prompt="/usr/share/git-core/contrib/completion/git-prompt.sh" - local dst_git_prompt="/etc/profile.d/git-prompt.sh" - if [ -f "${src_git_prompt}" ]; then - info "installing git-prompt to define __git_ps1" - [ ! -e "${dst_git_prompt}" ] && ln -s ${src_git_prompt} ${dst_git_prompt} - fi - local dotfile_install_cmd="${DOTFILES_DIR}/install.sh --offline --force -d ${DOTFILES_DIR} --bash --screen" - if [ -d "${DOTFILES_DIR}" ]; then - info "installing dotfiles for 'root' user" - ${dotfile_install_cmd} - info "installing dotfiles for 'vagrant' user" - sudo -u vagrant ${dotfile_install_cmd} - fi -} - -setup_motd() { - local motd=/etc/motd - local has_figlet=$(which figlet 2>/dev/null) - info "setup ${motd}" - cat < ${motd} -================================================================================ - Welcome to the Vagrant box $(hostname) -================================================================================ -EOF - if [ -n "${has_figlet}" ]; then - cat <> ${motd} -$(${has_figlet} -w 80 -c "$(hostname -s)") -EOF - fi - cat <> ${motd} -================================================================================ - Hostname.... $(hostname -f) - OS.......... $(facter os.name) $(facter os.release.full) - Support..... ${SUPPORT_MAIL} - Docs........ Vagrant: http://docs.vagrantup.com/v2/ -================================================================================ -EOF -} - -setup_gems() { - sudo gem install --no-ri --no-rdoc ${GEMS} -} - -###################################################################################### -[ $UID -gt 0 ] && error "You must be root to execute this script (current uid: $UID)" - - -# Parse the command-line options -while [ $# -ge 1 ]; do - case $1 in - -h | --help) print_usage; exit 0;; - -V | --version) print_version; exit 0;; - -n | --name) shift; NAME=$1;; - -t | --title) shift; TITLE=$1;; - -st| --subtitle) shift; SUBTITLE=$1;; - -d | --desc) shift; DESC=$1;; - -s | --support) shift; SUPPORT_MAIL=$1;; - -x | --extras) shift; EXTRA_PACKAGES=$1;; - esac - shift -done - -# Let's go -case "$OSTYPE" in - linux*) setup_linux ;; - *) echo "unknown: $OSTYPE"; exit 1;; -esac - -[ -f /usr/bin/puppet ] || ln -s /opt/puppetlabs/puppet/bin/puppet /usr/bin/puppet -[ -f /usr/bin/facter ] || ln -s /opt/puppetlabs/puppet/bin/facter /usr/bin/facter - -setup_dotfiles -setup_motd -setup_gems diff --git a/tests/vagrant/config.yaml b/tests/vagrant/config.yaml deleted file mode 100644 index 665b392..0000000 --- a/tests/vagrant/config.yaml +++ /dev/null @@ -1,51 +0,0 @@ -# -*- mode: yaml; -*- -# Time-stamp: -################################################################################ -# Complementary configuration for Vagrant -# You can overwrite here the default settings defined in ../../Vagrantfile and -# define additional VMs (agents) to deploy upon vagrant up (in addition to the -# puppet master 'master') - -#___________________________________________ -# Complete / re-define the default boxes below -# Format: -# :: / # see https://vagrantcloud.com -# :boxes: -# :windows2012: 'opentable/win-2012r2-standard-amd64-nocm' -# :freebsd12: 'freebsd/FreeBSD-12.0-RELEASE' -# :centos7: 'centos/7', -# :debian8: 'debian/contrib-jessie64', -# :ubuntu14: 'ubuntu/trusty64' - -#_________________ -# Default settings -# :defaults: -# :os: :centos7 # Default OS from the above box definition -# :ram: 512 # Default RAM -# :vcpus: 1 # Default number of virtual CPUs -# :vbguest_auto_update: 1 # check/update box guest additions - -#____________________ -# Network settings -# :network: -# :domain: 'vagrant.dev' # network domain to use -# :range: '10.10.1.0/24' # IP range to use -# :ip_offset: 10 -# # client / VMs defined below will start on xx.xx.xx. - -#___________________________________________________________ -# VMs / Vagrant boxes to define apart from the puppet master -# Format: -# : -# :hostname: -# :desc: -# :os: -# :ram: -# :vcpus: -# :role: -# :roles: -# - -# - -# :vms: -# 'default': -# :os: :debian8 diff --git a/tests/vagrant/puppet_modules_setup.rb b/tests/vagrant/puppet_modules_setup.rb deleted file mode 100644 index ff4be0e..0000000 --- a/tests/vagrant/puppet_modules_setup.rb +++ /dev/null @@ -1,74 +0,0 @@ -#!/usr/bin/env ruby -########################################################################## -# puppet_module_setup.rb -# @author Sebastien Varrette -# Time-stamp: -# -# @description Prepare the Vagrant box to test this Puppet module -# -# Copyright (c) 2014-2017 Sebastien Varrette -# . http://varrette.gforge.uni.lu -############################################################################## - -require 'json' -require 'yaml' -require 'falkorlib' - -include FalkorLib::Common - -# Load metadata -basedir = File.directory?('/vagrant') ? '/vagrant' : Dir.pwd -jsonfile = File.join( basedir, 'metadata.json') -puppetdir = '/etc/puppetlabs' - -error "Unable to find the metadata.json" unless File.exists?(jsonfile) - -metadata = JSON.parse( IO.read( jsonfile ) ) -name = metadata["name"].gsub(/^[^\/-]+[\/-]/,'') -modulepath=`puppet config print modulepath`.chomp -moduledir=modulepath.split(':').first - - -run %{ cd #{moduledir}/.. && librarian-puppet clean && rm Puppetfile* } -run %{ ln -s /vagrant/metadata.json #{moduledir}/../ } -run %{ cd #{moduledir}/.. && librarian-puppet install --verbose } - - -# metadata["dependencies"].each do |dep| -# lib = dep["name"] -# shortname = lib.gsub(/^.*[\/-]/,'') -# action = File.directory?("#{moduledir}/#{shortname}") ? 'upgrade --force' : 'install' -# run %{ puppet module #{action} #{lib} } -# end - -puts "Module path: #{modulepath}" -puts "Moduledir: #{moduledir}" - -info "set symlink to the '#{basedir}' module for local developments" -run %{ ln -s #{basedir} #{moduledir}/#{name} } unless File.exists?("#{moduledir}/#{name}") - -# Use of 'hiera.yaml' version 3 is deprecated. It should be converted to version 5 -hiera = '/etc/puppetlabs/puppet/hiera.yaml' - - - - -# Prepare hiera -# unless File.exists?('/etc/puppet/hiera.yaml') -# run %{ ln -s /etc/hiera.yaml /etc/puppet/hiera.yaml } if File.exists?("/etc/hiera.yaml") -# end -# # # hieracfg = YAML::load_file('/etc/hiera.yaml') -# # # [ '/vagrant/tests/hiera' ].each do |d| -# # # hieracfg[:datadir] = [] if hieracfg[:datadir].nil? -# # # hieracfg[:datadir] << d #if File.directory?('#{d}') -# # # end -# # # hieracfg[:hierarchy] = [] if hieracfg[:hierarchy].nil? -# # # hieracfg[:hierarchy] << 'common' unless hieracfg[:hierarchy].include?('common') -# hieracfg = { -# :backends => [ 'yaml' ], -# :hierarchy => [ 'defaults', 'common' ], -# :yaml => { -# :datadir => '/vagrant/tests/hiera', -# } -# } -# FalkorLib::Common.store_config('/etc/hiera.yaml', hieracfg, {:no_interaction => true}) From d3fb353607252767bb2287f39641cc6791eee89e Mon Sep 17 00:00:00 2001 From: Hyacinthe Cartiaux Date: Wed, 13 May 2026 16:03:45 +0200 Subject: [PATCH 7/9] chore: modernize metadata.json --- metadata.json | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/metadata.json b/metadata.json index 017768d..d268660 100644 --- a/metadata.json +++ b/metadata.json @@ -2,19 +2,15 @@ "name": "ULHPC-dhcp", "version": "0.3.4", "author": "UL HPC DevOps Team", - "mail": "hpc-sysadmins@uni.lu", "summary": "Configure ISC DHCP client and server", - "description": "Configure DHCP client and server", "license": "GPL-3.0", "source": "https://github.com/ULHPC/puppet-dhcp", - "docs_project": "ulhpc-puppet-dhcp", "project_page": "https://github.com/ULHPC/puppet-dhcp", "issues_url": "https://github.com/ULHPC/puppet-dhcp/issues", - "forge_url": "https://forge.puppetlabs.com/ULHPC/dhcp", "dependencies": [ { "name": "puppetlabs-stdlib", - "version_requirement": ">=4.2.2 <5.0.0" + "version_requirement": ">=4.2.2 <10.0.0" }, { "name": "puppet/rsyslog", @@ -30,32 +26,34 @@ ] }, { - "operatingsystem": "Centos", + "operatingsystem": "RedHat", "operatingsystemrelease": [ - "7" + "7", + "8", + "9" ] }, { "operatingsystem": "Rocky", "operatingsystemrelease": [ + "8", "9" ] + }, + { + "operatingsystem": "CentOS", + "operatingsystemrelease": [ + "7" + ] + } + ], + "requirements": [ + { + "name": "puppet", + "version_requirement": ">= 8.0.0 < 9.0.0" } ], "tags": [ "dhcp" - ], - "classes": [ - "dhcp", - "dhcp::client", - "dhcp::client::common", - "dhcp::client::common::debian", - "dhcp::client::common::redhat", - "dhcp::params", - "dhcp::server", - "dhcp::server::common", - "dhcp::server::common::debian", - "dhcp::server::common::redhat" - ], - "definitions": [] -} \ No newline at end of file + ] +} From 874fb08d658624e735466146eeb2510e99baa3b1 Mon Sep 17 00:00:00 2001 From: Hyacinthe Cartiaux Date: Wed, 13 May 2026 16:08:11 +0200 Subject: [PATCH 8/9] refactor: lint --- manifests/client.pp | 23 ++-- manifests/client/common.pp | 12 +- manifests/client/common/debian.pp | 2 +- manifests/client/common/redhat.pp | 2 +- manifests/params.pp | 212 +++++++++++++++--------------- manifests/server.pp | 31 +++-- manifests/server/common.pp | 99 +++++++------- manifests/server/common/debian.pp | 2 +- manifests/server/common/redhat.pp | 2 +- 9 files changed, 189 insertions(+), 196 deletions(-) diff --git a/manifests/client.pp b/manifests/client.pp index 3ebc005..fc5d3f0 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -35,19 +35,18 @@ # # [Remember: No empty lines between comments and class definition] # -class dhcp::client( $ensure = $dhcp::params::ensure ) inherits dhcp::params -{ - info ("Configuring dhcp::client (with ensure = ${ensure})") +class dhcp::client ( $ensure = $dhcp::params::ensure ) inherits dhcp::params { + info ("Configuring dhcp::client (with ensure = ${ensure})") - if ! ($ensure in [ 'present', 'absent' ]) { - fail("dhcp::client 'ensure' parameter must be set to either 'absent' or 'present'") - } + if ! ($ensure in ['present', 'absent']) { + fail("dhcp::client 'ensure' parameter must be set to either 'absent' or 'present'") + } - case $facts['os']['name'] { - 'debian', 'ubuntu': { include dhcp::client::common::debian } - 'redhat', 'fedora', 'centos', 'rocky': { include dhcp::client::common::redhat } - default: { - fail("Module ${module_name} is not supported on ${facts['os']['name']}") - } + case $facts['os']['name'] { + 'debian', 'ubuntu': { include dhcp::client::common::debian } + 'redhat', 'fedora', 'centos', 'rocky': { include dhcp::client::common::redhat } + default: { + fail("Module ${module_name} is not supported on ${facts['os']['name']}") } + } } diff --git a/manifests/client/common.pp b/manifests/client/common.pp index 38dbaf7..2341209 100644 --- a/manifests/client/common.pp +++ b/manifests/client/common.pp @@ -10,12 +10,10 @@ # # Note: respect the Naming standard provided here[http://projects.puppetlabs.com/projects/puppet/wiki/Module_Standards] class dhcp::client::common { + # Load the variables used in this module. Check the dhcp-params.pp file + require dhcp::params - # Load the variables used in this module. Check the dhcp-params.pp file - require dhcp::params - - package { $dhcp::params::client_package: - ensure => $dhcp::client::ensure, - } - + package { $dhcp::params::client_package: + ensure => $dhcp::client::ensure, + } } diff --git a/manifests/client/common/debian.pp b/manifests/client/common/debian.pp index bc99272..64cbedb 100644 --- a/manifests/client/common/debian.pp +++ b/manifests/client/common/debian.pp @@ -7,4 +7,4 @@ # = Class: dhcp::client::common::debian # # Specialization class for Debian systems -class dhcp::client::common::debian inherits dhcp::client::common { } +class dhcp::client::common::debian inherits dhcp::client::common {} diff --git a/manifests/client/common/redhat.pp b/manifests/client/common/redhat.pp index 715e1a0..02d4bc3 100644 --- a/manifests/client/common/redhat.pp +++ b/manifests/client/common/redhat.pp @@ -7,4 +7,4 @@ # = Class: dhcp::client::common::redhat # # Specialization class for Redhat systems -class dhcp::client::common::redhat inherits dhcp::client::common { } +class dhcp::client::common::redhat inherits dhcp::client::common {} diff --git a/manifests/params.pp b/manifests/params.pp index 200f815..ab09b77 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -23,119 +23,117 @@ # [Remember: No empty lines between comments and class definition] # class dhcp::params { + ######## DEFAULTS FOR VARIABLES USERS CAN SET ########################## + # (Here are set the defaults, provide your custom variables externally) + # (The default used is in the line with '') + ########################################### - ######## DEFAULTS FOR VARIABLES USERS CAN SET ########################## - # (Here are set the defaults, provide your custom variables externally) - # (The default used is in the line with '') - ########################################### + # ensure the presence (or absence) of dhcp + $ensure = 'present' + # The Protocol used. Used by monitor and firewall class. Default is 'udp' + $protocol = 'udp' + # The port number. Used by monitor and firewall class. The default is 67. + $port = 67 - # ensure the presence (or absence) of dhcp - $ensure = 'present' - # The Protocol used. Used by monitor and firewall class. Default is 'udp' - $protocol = 'udp' - # The port number. Used by monitor and firewall class. The default is 67. - $port = 67 + #### MODULE INTERNAL VARIABLES ######### + # (Modify to adapt to unsupported OSes) + ####################################### + if ($facts['os']['family'] == 'RedHat' and Integer($facts['os']['release']['major']) <= 7) { + $support_rsyslog = false + } else { + $support_rsyslog = true + } - #### MODULE INTERNAL VARIABLES ######### - # (Modify to adapt to unsupported OSes) - ####################################### - if ($facts['os']['family'] == 'RedHat' and Integer($facts['os']['release']['major']) <= 7) { - $support_rsyslog = false - } else { - $support_rsyslog = true - } + $client_package = $facts['os']['name'] ? { + /(?i-mx:centos|fedora|redhat|rocky)/ => $facts['os']['release']['major'] ? { + 7 => 'dhclient', + default => 'dhcp-client' + }, + /(?i-mx:ubuntu|debian)/ => $facts['os']['distro']['codename'] ? { + /(?i-mx:wheezy|jessie)/ => 'isc-dhcp-client', + default => 'dhcp3-client' + }, + default => 'dhcp3-client', + } - $client_package = $facts['os']['name'] ? { - /(?i-mx:centos|fedora|redhat|rocky)/ => $facts['os']['release']['major'] ? { - 7 => 'dhclient', - default => 'dhcp-client' - }, - /(?i-mx:ubuntu|debian)/ => $facts['os']['distro']['codename'] ? { - /(?i-mx:wheezy|jessie)/ => 'isc-dhcp-client', - default => 'dhcp3-client' - }, - default => 'dhcp3-client', - } + # DHCP Server configuration + $server_package = $facts['os']['name'] ? { + /(?i-mx:centos|fedora|redhat|rocky)/ => $facts['os']['release']['major'] ? { + 7 => 'dhcp', + default => 'dhcp-server' + }, + /(?i-mx:ubuntu|debian)/ => $facts['os']['distro']['codename'] ? { + /(?i-mx:squeeze|wheezy|jessie)/ => 'isc-dhcp-server', + default => 'dhcp3-server' + }, + default => 'dhcp' + } + $servicename = $facts['os']['name'] ? { + /(?i-mx:ubuntu|debian)/ => $facts['os']['distro']['codename'] ? { + /(?i-mx:squeeze|wheezy|jessie)/ => 'isc-dhcp-server', + default => 'dhcp3-server' + }, + default => 'dhcpd' + } - # DHCP Server configuration - $server_package = $facts['os']['name'] ? { - /(?i-mx:centos|fedora|redhat|rocky)/ => $facts['os']['release']['major'] ? { - 7 => 'dhcp', - default => 'dhcp-server' - }, - /(?i-mx:ubuntu|debian)/ => $facts['os']['distro']['codename'] ? { - /(?i-mx:squeeze|wheezy|jessie)/ => 'isc-dhcp-server', - default => 'dhcp3-server' - }, - default => 'dhcp' - } - $servicename = $facts['os']['name'] ? { - /(?i-mx:ubuntu|debian)/ => $facts['os']['distro']['codename'] ? { - /(?i-mx:squeeze|wheezy|jessie)/ => 'isc-dhcp-server', - default => 'dhcp3-server' - }, - default => 'dhcpd' - } + # used for pattern in a service ressource + $processname = $facts['os']['name'] ? { + /(?i-mx:ubuntu|debian)/ => $facts['os']['distro']['codename'] ? { + /(?i-mx:squeeze|wheezy|jessie)/ => 'dhcpd', + default => 'dhcpd3' + }, + default => 'dhcpd', + } + $hasstatus = $facts['os']['name'] ? { + /(?i-mx:ubuntu|debian)/ => false, + /(?i-mx:centos|fedora|redhat|rocky)/ => true, + default => true, + } + $hasrestart = $facts['os']['name'] ? { + default => true, + } - # used for pattern in a service ressource - $processname = $facts['os']['name'] ? { - /(?i-mx:ubuntu|debian)/ => $facts['os']['distro']['codename'] ? { - /(?i-mx:squeeze|wheezy|jessie)/ => 'dhcpd', - default => 'dhcpd3' - }, - default => 'dhcpd', - } - $hasstatus = $facts['os']['name'] ? { - /(?i-mx:ubuntu|debian)/ => false, - /(?i-mx:centos|fedora|redhat|rocky)/ => true, - default => true, - } - $hasrestart = $facts['os']['name'] ? { - default => true, - } + # Configuration file + $configfile = $facts['os']['name'] ? { + /(?i-mx:ubuntu|debian)/ => $facts['os']['distro']['codename'] ? { + /(?i-mx:squeeze|wheezy|jessie)/ => '/etc/dhcp/dhcpd.conf', + default => '/etc/dhcp3/dhcpd.conf' + }, + default => '/etc/dhcp/dhcpd.conf' + } + $configfile_owner = $facts['os']['name'] ? { + default => 'root', + } + $configfile_group = $facts['os']['name'] ? { + default => 'root', + } + $configfile_mode = $facts['os']['name'] ? { + default => '0644', + } - # Configuration file - $configfile = $facts['os']['name'] ? { - /(?i-mx:ubuntu|debian)/ => $facts['os']['distro']['codename'] ? { - /(?i-mx:squeeze|wheezy|jessie)/ => '/etc/dhcp/dhcpd.conf', - default => '/etc/dhcp3/dhcpd.conf' - }, - default => '/etc/dhcp/dhcpd.conf' - } - $configfile_owner = $facts['os']['name'] ? { - default => 'root', - } - $configfile_group = $facts['os']['name'] ? { - default => 'root', - } - $configfile_mode = $facts['os']['name'] ? { - default => '0644', - } - - # Configuration directory - $configdir = $facts['os']['name'] ? { - /(?i-mx:ubuntu|debian)/ => $facts['os']['distro']['codename'] ? { - /(?i-mx:squeeze|wheezy|jessie)/ => '/etc/dhcp', - default => '/etc/dhcp3' - }, - default => '/etc/dhcp' - } - $configdir_mode = $facts['os']['name'] ? { - default => '0750', - } - $configdir_owner = $facts['os']['name'] ? { - default => 'root', - } - $configdir_group = $facts['os']['name'] ? { - default => 'root', - } - - $initconfigfile = $facts['os']['name'] ? { - /(?i-mx:ubuntu|debian)/ => $facts['os']['distro']['codename'] ? { - /(?i-mx:squeeze|wheezy|jessie)/ => '/etc/default/isc-dhcp-server', - default => '/etc/default/dhcp3-server', - }, - default => '/etc/sysconfig/dhcpd', - } + # Configuration directory + $configdir = $facts['os']['name'] ? { + /(?i-mx:ubuntu|debian)/ => $facts['os']['distro']['codename'] ? { + /(?i-mx:squeeze|wheezy|jessie)/ => '/etc/dhcp', + default => '/etc/dhcp3' + }, + default => '/etc/dhcp' + } + $configdir_mode = $facts['os']['name'] ? { + default => '0750', + } + $configdir_owner = $facts['os']['name'] ? { + default => 'root', + } + $configdir_group = $facts['os']['name'] ? { + default => 'root', + } + $initconfigfile = $facts['os']['name'] ? { + /(?i-mx:ubuntu|debian)/ => $facts['os']['distro']['codename'] ? { + /(?i-mx:squeeze|wheezy|jessie)/ => '/etc/default/isc-dhcp-server', + default => '/etc/default/dhcp3-server', + }, + default => '/etc/sysconfig/dhcpd', + } } diff --git a/manifests/server.pp b/manifests/server.pp index edcc562..f2134e4 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -35,24 +35,23 @@ # # [Remember: No empty lines between comments and class definition] # -class dhcp::server( - $ensure = $dhcp::params::ensure, - $content = undef, - $source = undef +class dhcp::server ( + $ensure = $dhcp::params::ensure, + $content = undef, + $source = undef ) -inherits dhcp::client -{ - info ("Configuring DHCP server (with ensure = ${ensure})") +inherits dhcp::client { + info ("Configuring DHCP server (with ensure = ${ensure})") - if ! ($ensure in [ 'present', 'absent' ]) { - fail("dhcp::server 'ensure' parameter must be set to either 'absent' or 'present'") - } + if ! ($ensure in ['present', 'absent']) { + fail("dhcp::server 'ensure' parameter must be set to either 'absent' or 'present'") + } - case $facts['os']['name'] { - 'debian', 'ubuntu': { include dhcp::server::common::debian } - 'redhat', 'fedora', 'centos', 'rocky': { include dhcp::server::common::redhat } - default: { - fail("Module ${module_name} is not supported on ${facts['os']['name']}") - } + case $facts['os']['name'] { + 'debian', 'ubuntu': { include dhcp::server::common::debian } + 'redhat', 'fedora', 'centos', 'rocky': { include dhcp::server::common::redhat } + default: { + fail("Module ${module_name} is not supported on ${facts['os']['name']}") } + } } diff --git a/manifests/server/common.pp b/manifests/server/common.pp index 6bbcd92..04a0f27 100644 --- a/manifests/server/common.pp +++ b/manifests/server/common.pp @@ -10,63 +10,62 @@ # # Note: respect the Naming standard provided here[http://projects.puppetlabs.com/projects/puppet/wiki/Module_Standards] class dhcp::server::common { + # Load the variables used in this module. Check the dhcp::server-params.pp file + require dhcp::params - # Load the variables used in this module. Check the dhcp::server-params.pp file - require dhcp::params + package { 'dhcpd': + ensure => $dhcp::server::ensure, + name => $dhcp::params::server_package, + } - package { 'dhcpd': - ensure => $dhcp::server::ensure, - name => $dhcp::params::server_package, - } + file { $dhcp::params::configdir: + ensure => 'directory', + owner => $dhcp::params::configdir_owner, + group => $dhcp::params::configdir_group, + mode => $dhcp::params::configdir_mode, + require => Package['dhcpd'], + } - file { $dhcp::params::configdir: - ensure => 'directory', - owner => $dhcp::params::configdir_owner, - group => $dhcp::params::configdir_group, - mode => $dhcp::params::configdir_mode, - require => Package['dhcpd'], - } + file { 'dhcpd.conf': + ensure => $dhcp::server::ensure, + path => $dhcp::params::configfile, + owner => $dhcp::params::configfile_owner, + group => $dhcp::params::configfile_group, + mode => $dhcp::params::configfile_mode, + require => [Package['dhcpd'], File[$dhcp::params::configdir]], + } - file { 'dhcpd.conf': - ensure => $dhcp::server::ensure, - path => $dhcp::params::configfile, - owner => $dhcp::params::configfile_owner, - group => $dhcp::params::configfile_group, - mode => $dhcp::params::configfile_mode, - require => [Package['dhcpd'], File[$dhcp::params::configdir]], + if ($dhcp::server::content != undef and $dhcp::server::source == undef) { + File['dhcpd.conf'] { + content => $dhcp::server::content } - - if ($dhcp::server::content != undef and $dhcp::server::source == undef) { - File['dhcpd.conf'] { - content => $dhcp::server::content - } - } elsif ($dhcp::server::content == undef and $dhcp::server::source != undef) { - File['dhcpd.conf'] { - source => $dhcp::server::source - } - } else { - fail("dhcp::server 'source' OR 'content' parameter must be set") + } elsif ($dhcp::server::content == undef and $dhcp::server::source != undef) { + File['dhcpd.conf'] { + source => $dhcp::server::source } + } else { + fail("dhcp::server 'source' OR 'content' parameter must be set") + } - if ($dhcp::params::support_rsyslog == true) { - rsyslog::component::custom_config { 'dhcpd': - content => "if \$syslogtag contains 'dhcpd' then /var/log/dhcpd.log\n& ~" - } + if ($dhcp::params::support_rsyslog == true) { + rsyslog::component::custom_config { 'dhcpd': + content => "if \$syslogtag contains 'dhcpd' then /var/log/dhcpd.log\n& ~", } + } - if ($dhcp::server::ensure == 'present') { - $service_ensure = 'running' - } else { - $service_ensure = 'stopped' - } - service { 'dhcpd': - ensure => $service_ensure, - name => $dhcp::params::servicename, - enable => true, - hasrestart => $dhcp::params::hasrestart, - pattern => $dhcp::params::processname, - hasstatus => $dhcp::params::hasstatus, - require => Package['dhcpd'], - subscribe => File['dhcpd.conf'], - } + if ($dhcp::server::ensure == 'present') { + $service_ensure = 'running' + } else { + $service_ensure = 'stopped' + } + service { 'dhcpd': + ensure => $service_ensure, + name => $dhcp::params::servicename, + enable => true, + hasrestart => $dhcp::params::hasrestart, + pattern => $dhcp::params::processname, + hasstatus => $dhcp::params::hasstatus, + require => Package['dhcpd'], + subscribe => File['dhcpd.conf'], + } } diff --git a/manifests/server/common/debian.pp b/manifests/server/common/debian.pp index 059967b..dc1de4a 100644 --- a/manifests/server/common/debian.pp +++ b/manifests/server/common/debian.pp @@ -7,4 +7,4 @@ # = Class: dhcp::server::common::debian # # Specialization class for Debian systems -class dhcp::server::common::debian inherits dhcp::server::common { } +class dhcp::server::common::debian inherits dhcp::server::common {} diff --git a/manifests/server/common/redhat.pp b/manifests/server/common/redhat.pp index e8d7cf1..b34254c 100644 --- a/manifests/server/common/redhat.pp +++ b/manifests/server/common/redhat.pp @@ -7,4 +7,4 @@ # = Class: dhcp::server::common::redhat # # Specialization class for Redhat systems -class dhcp::server::common::redhat inherits dhcp::server::common { } +class dhcp::server::common::redhat inherits dhcp::server::common {} From 39ae03007bcdce5c64989d0fdcfeaf891d33119f Mon Sep 17 00:00:00 2001 From: Hyacinthe Cartiaux Date: Wed, 13 May 2026 16:30:49 +0200 Subject: [PATCH 9/9] docs: update the README file --- README.md | 54 +++++++----------------------------------------------- 1 file changed, 7 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index 6af4424..b3662bf 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ --*- mode: markdown; mode: visual-line; -*- - # Dhcp Puppet Module [![Puppet Forge](http://img.shields.io/puppetforge/v/ULHPC/dhcp.svg)](https://forge.puppetlabs.com/ULHPC/dhcp) @@ -8,7 +6,7 @@ Configure DHCP client and server - Copyright (c) 2020 UL HPC DevOps Team + Copyright (c) 2026 UL HPC Team | [Project Page](https://github.com/ULHPC/puppet-dhcp) | [Sources](https://github.com/ULHPC/puppet-dhcp) | [Issues](https://github.com/ULHPC/puppet-dhcp/issues) | @@ -36,9 +34,6 @@ This module implements the following elements: All these components are configured through a set of variables you will find in [`manifests/params.pp`](manifests/params.pp). -_Note_: the various operations that can be conducted from this repository are piloted from a [`Rakefile`](https://github.com/ruby/rake) and assumes you have a running [Ruby](https://www.ruby-lang.org/en/) installation. -See `docs/contributing.md` for more details on the steps you shall follow to have this `Rakefile` working properly. - ## Dependencies See [`metadata.json`](metadata.json). In particular, this module depends on @@ -51,35 +46,10 @@ See [`metadata.json`](metadata.json). In particular, this module depends on ### Class `dhcp` This is the main class defined in this module. -It accepts the following parameters: - -* `$ensure`: default to 'present', can be 'absent' Use it as follows: - include ' dhcp' - -See also [`tests/init.pp`](tests/init.pp) - -### Class `dhcp::client` - -See [`tests/client.pp`](tests/client.pp) -### Class `dhcp::client::debian` - -See [`tests/client/debian.pp`](tests/client/debian.pp) -### Class `dhcp::client::redhat` - -See [`tests/client/redhat.pp`](tests/client/redhat.pp) -### Class `dhcp::server` - -See [`tests/server.pp`](tests/server.pp) -### Class `dhcp::server::debian` - -See [`tests/server/debian.pp`](tests/server/debian.pp) -### Class `dhcp::server::redhat` - -See [`tests/server/redhat.pp`](tests/server/redhat.pp) - + include 'dhcp' ## Librarian-Puppet / R10K Setup @@ -93,26 +63,16 @@ or, if you prefer to work on the git version: mod "ULHPC/dhcp", :git => 'https://github.com/ULHPC/puppet-dhcp', - :ref => 'production' - -## Issues / Feature request + :ref => 'main' -You can submit bug / issues / feature request using the [ULHPC/dhcp Puppet Module Tracker](https://github.com/ULHPC/puppet-dhcp/issues). +## Developments / Issues / Contributing to the code -## Developments / Contributing to the code - -If you want to contribute to the code, you shall be aware of the way this module is organized. -These elements are detailed on [`docs/contributing.md`](contributing/index.md). +This Puppet Module has been implemented in the context of the [UL HPC](http://hpc.uni.lu) Platform of the [University of Luxembourg](http://www.uni.lu). +It relies on [Vox Pupuli modulesync](https://github.com/voxpupuli/modulesync) for its organization. +You can submit bugs / issues / feature requests using the [ULHPC/dhcp Puppet Module Tracker](https://github.com/ULHPC/puppet-dhcp/issues). You are more than welcome to contribute to its development by [sending a pull request](https://help.github.com/articles/using-pull-requests). -## Puppet modules tests within a Vagrant box - -The best way to test this module in a non-intrusive way is to rely on [Vagrant](http://www.vagrantup.com/). -The `Vagrantfile` at the root of the repository pilot the provisioning various vagrant boxes available on [Vagrant cloud](https://atlas.hashicorp.com/boxes/search?utf8=%E2%9C%93&sort=&provider=virtualbox&q=svarrette) you can use to test this module. - -See [`docs/vagrant.md`](vagrant.md) for more details. - ## Licence This project and the sources proposed within this repository are released under the terms of the [GPL-3.0](LICENCE) licence.