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 54c314b..adea1b0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,25 @@
-.DS_Store
-.vagrant
-/.bundle/*
-.falkor*
-/pkg/*
-resources/*
+# 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-gemset b/.ruby-gemset
deleted file mode 100644
index 17cb753..0000000
--- a/.ruby-gemset
+++ /dev/null
@@ -1 +0,0 @@
-puppet
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/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/README.md b/README.md
index 7964512..e5ed97f 100644
--- a/README.md
+++ b/README.md
@@ -15,8 +15,8 @@ Configure and manage Bourne Again SHell (Bash) dotfiles and profiles
## Synopsis
-Configure and manage Bourne Again SHell (Bash) dotfiles and profile.
- Bourne Again SHell (Bash) is the GNU Project's shell. Bash is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. It offers functional improvements over sh for both programming and interactive use. In addition, most sh scripts can be run by Bash without modification..
+Configure and manage Bourne Again SHell (Bash) dotfiles and profile.
+ Bourne Again SHell (Bash) is the GNU Project's shell. Bash is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. It offers functional improvements over sh for both programming and interactive use. In addition, most sh scripts can be run by Bash without modification.
This module implements the following elements:
@@ -88,14 +88,12 @@ Example:
include bash
- bash::setup{ '/home/vagrant':
+ bash::setup{ '/home/ulhpc':
ensure => 'present',
- user => 'vagrant',
- group => 'vagrant',
+ user => 'ulhpc',
+ group => 'ulhpc',
}
-See also [`tests/vagrant_setup.pp`](tests/vagrant_setup.pp) or [`tests/vagrant_setup_absent.pp`](tests/vagrant_setup_absent.pp)
-
### Definition `bash::config`
Permit to define a global or local bash configuration.
@@ -133,7 +131,7 @@ Example:
export MODULEPATH='$HOME/.local/easybuild/modules/all:/opt/apps/easybuild/modules/all:/opt/apps/default/modules/all:$HOME/privatemodules:$HOME/easybuild/modules/all'"
}
-See also [`tests/config.pp`](tests/config.pp) or [`tests/config_vagrant.pp`](tests/config_vagrant.pp)
+See also [`tests/config.pp`](tests/config.pp)
## Librarian-Puppet / R10K Setup
@@ -161,13 +159,6 @@ These elements are detailed on [`docs/contributing.md`](contributing/index.md).
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 [Apache-2.0](LICENCE) licence.
diff --git a/REFERENCE.md b/REFERENCE.md
new file mode 100644
index 0000000..c12a559
--- /dev/null
+++ b/REFERENCE.md
@@ -0,0 +1,473 @@
+# Reference
+
+
+
+## Table of Contents
+
+### Classes
+
+* [`bash`](#bash): File:: init.pp Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team (hpc-sysadmins@uni.lu) Co
+* [`bash::common`](#bash--common): File:: common.pp Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team (hpc-sysadmins@uni.lu)
+* [`bash::common::debian`](#bash--common--debian): File:: common/debian.pp Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team (hpc-sysadmins@u
+* [`bash::common::redhat`](#bash--common--redhat): File:: common/redhat.pp Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team (hpc-sysadmins@u
+* [`bash::params`](#bash--params): File:: params.pp Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team (hpc-sysadmins@uni.lu)
+
+### Defined types
+
+* [`bash::config`](#bash--config): File:: config.pp Author:: Sebastien Varrette () Copyright:: Copyright (c) 2015 Sebastien Varrette
+* [`bash::setup`](#bash--setup): File:: setup.pp Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team (hpc-sysadmins@uni.lu) C
+
+## Classes
+
+### `bash`
+
+File:: init.pp
+Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team (hpc-sysadmins@uni.lu)
+Copyright:: Copyright (c) 2015 S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team
+License:: Apache-2.0
+
+------------------------------------------------------------------------------
+= Class: bash
+
+Configure and manage Bash dotfiles and profiles
+
+== Parameters:
+
+$ensure:: *Default:* 'present'. Ensure the presence (or absence) of ULHPC/bash
+$aliases:: Hash of key / command values to place in a aliases files
+$aliases_file:: *Default:* '/etc/profiles.d/bash_aliases.sh' config file where the aliases are placed.
+$dotfiles_provider:: *Default:* 'git'. Type of dotfiles provider
+$dotfiles_src:: *Default:* 'https://github.com/ULHPC/dotfiles.git'. [Git] repository URL of the dotfiles.
+$dotfiles_revision:: *Default:* 'master'. [git] branch / revision / tag to use.
+
+== Actions:
+
+Install and configure bash
+
+== Requires:
+
+n/a
+
+== Sample Usage:
+
+ include 'bash'
+
+You can then specialize the various aspects of the configuration,
+for instance:
+
+ class { 'bash':
+ ensure => 'present',
+ dotfiles_src => 'https://github.com/Falkor/dotfiles',
+ }
+
+== Warnings
+
+/!\ Always respect the style guide available
+here[http://docs.puppetlabs.com/guides/style_guide]
+
+
+[Remember: No empty lines between comments and class definition]
+
+#### Parameters
+
+The following parameters are available in the `bash` class:
+
+* [`aliases`](#-bash--aliases)
+* [`aliases_file`](#-bash--aliases_file)
+* [`ensure`](#-bash--ensure)
+* [`dotfiles_provider`](#-bash--dotfiles_provider)
+* [`dotfiles_src`](#-bash--dotfiles_src)
+* [`dotfiles_revision`](#-bash--dotfiles_revision)
+
+##### `aliases`
+
+Data type: `Any`
+
+
+
+Default value: `$bash::params::aliases`
+
+##### `aliases_file`
+
+Data type: `Any`
+
+
+
+Default value: `$bash::params::aliases_file`
+
+##### `ensure`
+
+Data type: `Any`
+
+
+
+Default value: `$bash::params::ensure`
+
+##### `dotfiles_provider`
+
+Data type: `Any`
+
+
+
+Default value: `$bash::params::dotfiles_provider`
+
+##### `dotfiles_src`
+
+Data type: `Any`
+
+
+
+Default value: `$bash::params::dotfiles_src`
+
+##### `dotfiles_revision`
+
+Data type: `Any`
+
+
+
+Default value: `$bash::params::dotfiles_revision`
+
+### `bash::common`
+
+File:: common.pp
+Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team (hpc-sysadmins@uni.lu)
+Copyright:: Copyright (c) 2015 S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team
+License:: Apache-2.0
+
+------------------------------------------------------------------------------
+= Class: bash::common
+
+Base class to be inherited by the other bash classes, containing the common code.
+
+Note: respect the Naming standard provided here[http://projects.puppetlabs.com/projects/puppet/wiki/Module_Standards]
+
+### `bash::common::debian`
+
+File:: common/debian.pp
+Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team (hpc-sysadmins@uni.lu)
+Copyright:: Copyright (c) 2015 S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team
+License:: Apache-2.0
+
+------------------------------------------------------------------------------
+= Class: bash::common::debian
+
+Specialization class for Debian systems
+
+### `bash::common::redhat`
+
+File:: common/redhat.pp
+Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team (hpc-sysadmins@uni.lu)
+Copyright:: Copyright (c) 2015 S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team
+License:: Apache-2.0
+
+------------------------------------------------------------------------------
+= Class: bash::common::redhat
+
+Specialization class for Redhat systems
+
+### `bash::params`
+
+File:: params.pp
+Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team (hpc-sysadmins@uni.lu)
+Copyright:: Copyright (c) 2015 S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team
+License:: Apache-2.0
+
+------------------------------------------------------------------------------
+= Class: bash::params
+
+In this class are defined as variables values that are used in other
+bash classes.
+This class should be included, where necessary, and eventually be enhanced
+with support for more OS
+
+== Warnings
+
+/!\ Always respect the style guide available
+here[http://docs.puppetlabs.com/guides/style_guide]
+
+The usage of a dedicated param classe is advised to better deal with
+parametrized classes, see
+http://docs.puppetlabs.com/guides/parameterized_classes.html
+
+[Remember: No empty lines between comments and class definition]
+
+## Defined types
+
+### `bash::config`
+
+File:: config.pp
+Author:: Sebastien Varrette ()
+Copyright:: Copyright (c) 2015 Sebastien Varrette (www[])
+License:: GPLv3
+
+------------------------------------------------------------------------------
+= Class: bash::config
+
+Configure a new hook part of the bash configuration.
+
+== Pre-requisites
+
+* The class 'bash' should have been instanciated
+
+== Parameters
+
+[*ensure*]
+ default to 'present', can be 'absent'.
+ Default: 'present'
+
+[*content*]
+ Specify the contents of the bash::config entry as a string. Newlines, tabs,
+ and spaces can be specified using the escaped syntax (e.g., \n for a newline)
+
+[*source*]
+ Copy a file as the content of the bash::config entry.
+ Uses checksum to determine when a file should be copied.
+ Valid values are either fully qualified paths to files, or URIs. Currently
+ supported URI types are puppet and file.
+ In neither the 'source' or 'content' parameter is specified, then the
+ following parameters can be used to set the console entry.
+
+[*owner*]
+ Specifies the owner of the destination file. Valid options: a string containing a username.
+ Default: 'root'
+
+[*group*]
+ Specifies a permissions group for the destination file. Valid options: a string containing a group name.
+ Default: 'root'
+
+[*mode*]
+ Specifies the permissions mode of the destination file. Valid options: a string containing a permission mode value in octal notation.
+ Default: '0644'
+
+[*rootdir*]
+ Specifies a root directory hosting the bash configuration file.
+ Set it to a homedir (and precise the owner and group directives) to make the configuration local and
+ placed to /.bash.d/.bash
+ Default: /etc/profile.d
+
+[*before_hook*]
+ Specifies if the bash configuration should be placed as a before hook.
+ Only valid if rootdir is set. Then the configuration file will be placed in
+ /.bash.before.d/.bash
+ Default: false
+
+[*warn*]
+ Specifies whether to add a header message at the top of the destination file.
+ Valid options: the booleans 'true' and 'false', or a string to serve as the header.
+ Default: 'false'.
+
+=== Sample usage
+
+ include 'bash'
+ bash::local::before { 'sysadminrc':
+ ensure => 'present',
+ path => '/var/lib/localadmin',
+ content => "[[ -f '~/.sysadminrc' ]] && source ~/.sysadminrc"
+ }
+
+
+
+== Warnings
+
+ /!\ Always respect the style guide available
+ here[http://docs.puppetlabs.com/guides/style_guide]
+
+ [Remember: No empty lines between comments and class definition]
+
+#### Parameters
+
+The following parameters are available in the `bash::config` defined type:
+
+* [`ensure`](#-bash--config--ensure)
+* [`content`](#-bash--config--content)
+* [`source`](#-bash--config--source)
+* [`rootdir`](#-bash--config--rootdir)
+* [`before_hook`](#-bash--config--before_hook)
+* [`warn`](#-bash--config--warn)
+* [`owner`](#-bash--config--owner)
+* [`group`](#-bash--config--group)
+* [`mode`](#-bash--config--mode)
+
+##### `ensure`
+
+Data type: `Any`
+
+
+
+Default value: `'present'`
+
+##### `content`
+
+Data type: `Any`
+
+
+
+Default value: `''`
+
+##### `source`
+
+Data type: `Any`
+
+
+
+Default value: `''`
+
+##### `rootdir`
+
+Data type: `Any`
+
+
+
+Default value: `''`
+
+##### `before_hook`
+
+Data type: `Any`
+
+
+
+Default value: `false`
+
+##### `warn`
+
+Data type: `Any`
+
+
+
+Default value: `false`
+
+##### `owner`
+
+Data type: `Any`
+
+
+
+Default value: `'root'`
+
+##### `group`
+
+Data type: `Any`
+
+
+
+Default value: `'root'`
+
+##### `mode`
+
+Data type: `Any`
+
+
+
+Default value: `'0644'`
+
+### `bash::setup`
+
+File:: setup.pp
+Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team (hpc-sysadmins@uni.lu)
+Copyright:: Copyright (c) 2011-2015 S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team
+License:: Apache-2.0
+
+------------------------------------------------------------------------------
+= Defines: bash::setup
+
+Configures .bashrc and many other dotfiles (screenrc, bash aliases etc. ) for a given user
+
+== Parameters
+
+[*ensure*]
+ Default: 'present'.
+ Ensure the presence (or absence) of setup
+
+[*path*]
+ If the title of the resource is not the homedir to consider, use path to precise the
+ homedir to setup
+
+[*user*]
+ Default: 'root'
+ User that run the setup.
+ BEWARE: it SHALL be the owner of the home directory you're trying to setup!!!!
+
+[*group*]
+ Default: 'root'
+ As above but for the group operating the commands.
+ BEWARE again to use the appropriate group!
+
+== Actions
+
+ Configure the .bashrc etc. into a given home directory using specific configuration (see https://github.com/ULHPC/dotfiles).
+ Actually, it not only creates the symlinks for .bashrc, .inputrc but also for
+.screenrc and .gitconfig that are provided as part of the config.
+
+Note that it is expected that the dotfiles directory to contains an installation
+script 'install.sh' at the root of the repository that accept the '--delete' command.
+
+== Requires
+
+$path must be set (or $name will be considered as the basedir for installation)
+
+== Usage
+
+ Configuration for /root
+
+ bash::setup { '/root': }
+
+ Configuration for the user $user
+
+ bash::setup { "/home/${user}":
+ ensure => 'present'
+ user => "${user}",
+ group => "${user}",
+ }
+
+=== Authors
+
+The UL HPC Management team (see http://hpc.uni.lu)
+
+== Warnings
+
+/!\ Always respect the style guide available
+here[http://docs.puppetlabs.com/guides/style_guide]
+
+[Remember: No empty lines between comments and class definition]
+
+#### Parameters
+
+The following parameters are available in the `bash::setup` defined type:
+
+* [`path`](#-bash--setup--path)
+* [`ensure`](#-bash--setup--ensure)
+* [`user`](#-bash--setup--user)
+* [`group`](#-bash--setup--group)
+
+##### `path`
+
+Data type: `Any`
+
+
+
+Default value: `''`
+
+##### `ensure`
+
+Data type: `Any`
+
+
+
+Default value: `'present'`
+
+##### `user`
+
+Data type: `Any`
+
+
+
+Default value: `'root'`
+
+##### `group`
+
+Data type: `Any`
+
+
+
+Default value: `'root'`
+
diff --git a/Rakefile b/Rakefile
index 6cc925b..696b6d0 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-bash'
+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/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/contributing/index.md b/docs/contributing/index.md
index 110c1dd..c77018a 100644
--- a/docs/contributing/index.md
+++ b/docs/contributing/index.md
@@ -1,5 +1,5 @@
-This project is released under the terms of the [Apache-2.0 Licence](LICENSE).
-So you are more than welcome to contribute to its development as follows:
+This project is released under the terms of the [Apache-2.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[]`)
diff --git a/docs/contributing/layout.md b/docs/contributing/layout.md
index 0e95734..bac80d6 100644
--- a/docs/contributing/layout.md
+++ b/docs/contributing/layout.md
@@ -3,17 +3,15 @@ The directory hosting the implementation of this puppet module is organized as f
```
.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
+├── 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
@@ -21,7 +19,7 @@ The directory hosting the implementation of this puppet module is organized as f
│ ├── ... # Implementation of the other bash::* 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
+├── mkdocs.yml # [Read the Docs](readthedocs.org) configuration
├── pkg/ # Hold build packages to be published on the [Puppet forge](https://forge.puppetlabs.com/ULHPC/bash)
├── spec/ # (eventually) [Rspec](https://www.relishapp.com/rspec/) tests
├── templates/ # (eventually) Module ERB template files
diff --git a/docs/contributing/setup.md b/docs/contributing/setup.md
index 1a2a1b4..8cc342b 100644
--- a/docs/contributing/setup.md
+++ b/docs/contributing/setup.md
@@ -5,7 +5,7 @@ There is a number of pre-requisite programs / framework you shall install to be
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
+* `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).
diff --git a/docs/index.md b/docs/index.md
index a57dadf..fad9bd6 100644
--- a/docs/index.md
+++ b/docs/index.md
@@ -21,7 +21,6 @@ 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)
diff --git a/docs/vagrant.md b/docs/vagrant.md
deleted file mode 100644
index 4698e53..0000000
--- a/docs/vagrant.md
+++ /dev/null
@@ -1,79 +0,0 @@
--*- mode: markdown; mode: visual-line; -*-
-
-# Bash 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/manifests/common.pp b/manifests/common.pp
index 987b6e6..d6194da 100644
--- a/manifests/common.pp
+++ b/manifests/common.pp
@@ -10,73 +10,72 @@
#
# Note: respect the Naming standard provided here[http://projects.puppetlabs.com/projects/puppet/wiki/Module_Standards]
class bash::common {
+ # Load the variables used in this module. Check the params.pp file
+ require bash::params
- # Load the variables used in this module. Check the params.pp file
- require bash::params
+ package { 'bash':
+ ensure => 'present', # You shall NEVER remove the bash package
+ name => $bash::params::packagename,
+ }
- package { 'bash':
- ensure => 'present', # You shall NEVER remove the bash package
- name => $bash::params::packagename,
- }
+ package { $bash::params::extra_packages:
+ ensure => $bash::ensure,
+ }
- package { $bash::params::extra_packages:
- ensure => $bash::ensure,
+ # Our PS1 prompt requires git and subversion, git being ensured through the
+ # vcsrepo class call
+ if !defined(Package['subversion']) {
+ package { 'subversion':
+ ensure => $bash::ensure,
}
+ }
- # Our PS1 prompt requires git and subversion, git being ensured through the
- # vcsrepo class call
- if !defined(Package['subversion']) {
- package { 'subversion':
- ensure => $bash::ensure,
- }
- }
+ # Set File resource defaults
+ File {
+ owner => $bash::params::configdir_owner,
+ group => $bash::params::configdir_group,
+ }
- # Set File resource defaults
- File {
- owner => $bash::params::configdir_owner,
- group => $bash::params::configdir_group,
- }
+ file { $bash::aliases_file:
+ ensure => $bash::ensure,
+ mode => $bash::params::configfile_mode,
+ content => template("${module_name}/bash_aliases.sh.erb"),
+ }
- file { $bash::aliases_file:
- ensure => $bash::ensure,
- mode => $bash::params::configfile_mode,
- content => template("${module_name}/bash_aliases.sh.erb"),
- }
+ file { $bash::params::skel_dir:
+ ensure => 'directory',
+ mode => $bash::params::configdir_mode,
+ require => Package['bash'],
+ }
- file { $bash::params::skel_dir:
- ensure => 'directory',
- mode => $bash::params::configdir_mode,
- require => Package['bash'],
- }
+ file { $bash::params::completion_dir:
+ ensure => 'directory',
+ mode => $bash::params::configdir_mode,
+ require => Package['bash-completion'],
+ }
- file { $bash::params::completion_dir:
- ensure => 'directory',
- mode => $bash::params::configdir_mode,
- require => Package['bash-completion'],
- }
-
- # Force latest version of the dotfile
- # $vcs_ensure = $bash::ensure ? {
- # 'absent' => 'absent',
- # 'present' => 'latest',
- # default => $bash::ensure
- # }
+ # Force latest version of the dotfile
+ # $vcs_ensure = $bash::ensure ? {
+ # 'absent' => 'absent',
+ # 'present' => 'latest',
+ # default => $bash::ensure
+ # }
- # Prepare the reference dotfiles directory
- vcsrepo { $bash::ref_dotfilesdir:
- ensure => $bash::ensure,
- provider => $bash::dotfiles_provider,
- source => $bash::dotfiles_src,
- revision => $bash::dotfiles_revision,
- user => $bash::params::configdir_owner,
- group => $bash::params::configdir_group,
- submodules => false,
- }
+ # Prepare the reference dotfiles directory
+ vcsrepo { $bash::ref_dotfilesdir:
+ ensure => $bash::ensure,
+ provider => $bash::dotfiles_provider,
+ source => $bash::dotfiles_src,
+ revision => $bash::dotfiles_revision,
+ user => $bash::params::configdir_owner,
+ group => $bash::params::configdir_group,
+ submodules => false,
+ }
- # Apply it for root user
- bash::setup { '/root':
- ensure => $bash::ensure,
- user => $bash::params::configdir_owner,
- group => $bash::params::configdir_group,
- }
+ # Apply it for root user
+ bash::setup { '/root':
+ ensure => $bash::ensure,
+ user => $bash::params::configdir_owner,
+ group => $bash::params::configdir_group,
+ }
}
diff --git a/manifests/common/redhat.pp b/manifests/common/redhat.pp
index 679d151..0e44af9 100644
--- a/manifests/common/redhat.pp
+++ b/manifests/common/redhat.pp
@@ -8,10 +8,10 @@
#
# Specialization class for Redhat systems
class bash::common::redhat inherits bash::common {
- # BUGFIX on __git_ps1() missing
- # ln -s /usr/share/git-core/contrib/completion/git-prompt.sh /etc/profile.d/
- file { "${bash::params::profile_dir}/git-prompt.sh":
- ensure => 'link',
- target => '/usr/share/git-core/contrib/completion/git-prompt.sh',
- }
+ # BUGFIX on __git_ps1() missing
+ # ln -s /usr/share/git-core/contrib/completion/git-prompt.sh /etc/profile.d/
+ file { "${bash::params::profile_dir}/git-prompt.sh":
+ ensure => 'link',
+ target => '/usr/share/git-core/contrib/completion/git-prompt.sh',
+ }
}
diff --git a/manifests/config.pp b/manifests/config.pp
index a941b03..282f32e 100644
--- a/manifests/config.pp
+++ b/manifests/config.pp
@@ -77,93 +77,92 @@
#
# [Remember: No empty lines between comments and class definition]
#
-define bash::config(
- $ensure = 'present',
- $content = '',
- $source = '',
- $rootdir = '',
- $before_hook = false,
- $warn = false,
- $owner = 'root',
- $group = 'root',
- $mode = '0644'
-)
-{
- include bash::params
+define bash::config (
+ $ensure = 'present',
+ $content = '',
+ $source = '',
+ $rootdir = '',
+ $before_hook = false,
+ $warn = false,
+ $owner = 'root',
+ $group = 'root',
+ $mode = '0644'
+) {
+ include bash::params
- # $name is provided at define invocation
- $filename = $name
+ # $name is provided at define invocation
+ $filename = $name
- if ! ($ensure in [ 'present', 'absent' ]) {
- fail("bash::local::before 'ensure' parameter must be set to either 'absent' or 'present'")
- }
+ if ! ($ensure in ['present', 'absent']) {
+ fail("bash::local::before 'ensure' parameter must be set to either 'absent' or 'present'")
+ }
- if ($bash::ensure != $ensure) {
- if ($bash::ensure != 'present') {
- fail("Cannot configure a bash::config '${filename}' as bash::ensure is NOT set to present (but ${bash::ensure})")
- }
+ if ($bash::ensure != $ensure) {
+ if ($bash::ensure != 'present') {
+ fail("Cannot configure a bash::config '${filename}' as bash::ensure is NOT set to present (but ${bash::ensure})")
}
+ }
- # if content is passed, use that, else if source is passed use that
- case $content {
+ # if content is passed, use that, else if source is passed use that
+ case $content {
+ '': {
+ case $source {
'': {
- case $source {
- '': {
- crit('No content nor source have been specified')
- }
- default: {
- $real_source = $source
- $real_content = undef
- }
- }
+ crit('No content nor source have been specified')
}
default: {
- $real_content = $content
- $real_source = undef
+ $real_source = $source
+ $real_content = undef
}
+ }
}
-
- $dir = $rootdir ? {
- '' => "${bash::params::profile_dir}/",
- default => $before_hook ? {
- true => "${rootdir}/${bash::params::local_confdir_before}/",
- default => "${rootdir}/${bash::params::local_confdir}/"
- }
+ default: {
+ $real_content = $content
+ $real_source = undef
}
+ }
- if (! defined(File[$dir])) {
- $dir_ensure = $ensure ? {
- 'present' => 'directory',
- default => $ensure
- }
- file { $dir:
- ensure => $dir_ensure,
- force => true,
- owner => $owner,
- group => $group,
- mode => $bash::params::configdir_mode,
- }
+ $dir = $rootdir ? {
+ '' => "${bash::params::profile_dir}/",
+ default => $before_hook ? {
+ true => "${rootdir}/${bash::params::local_confdir_before}/",
+ default => "${rootdir}/${bash::params::local_confdir}/"
}
- $path = "${dir}/${filename}.bash"
+ }
- concat { $path:
- ensure => $ensure,
- warn => $warn,
- owner => $owner,
- group => $group,
- ensure_newline => true,
- require => File[$dir],
+ if (! defined(File[$dir])) {
+ $dir_ensure = $ensure ? {
+ 'present' => 'directory',
+ default => $ensure
}
+ file { $dir:
+ ensure => $dir_ensure,
+ force => true,
+ owner => $owner,
+ group => $group,
+ mode => $bash::params::configdir_mode,
+ }
+ }
+ $path = "${dir}/${filename}.bash"
- if $real_content {
- concat::fragment { $path:
- target => $path,
- content => $real_content,
- }
- } elsif $real_source {
- concat::fragment { $path:
- target => $path,
- source => $real_source,
- }
+ concat { $path:
+ ensure => $ensure,
+ warn => $warn,
+ owner => $owner,
+ group => $group,
+ ensure_newline => true,
+ require => File[$dir],
+ }
+
+ if $real_content {
+ concat::fragment { $path:
+ target => $path,
+ content => $real_content,
+ }
+ } elsif $real_source {
+ concat::fragment { $path:
+ target => $path,
+ source => $real_source,
}
+ }
}
diff --git a/manifests/init.pp b/manifests/init.pp
index 12d0de4..58dfbaa 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -45,30 +45,26 @@
#
# [Remember: No empty lines between comments and class definition]
#
-class bash(
- $aliases = $bash::params::aliases,
- $aliases_file = $bash::params::aliases_file,
- $ensure = $bash::params::ensure,
- $dotfiles_provider = $bash::params::dotfiles_provider,
- $dotfiles_src = $bash::params::dotfiles_src,
- $dotfiles_revision = $bash::params::dotfiles_revision
+class bash (
+ $aliases = $bash::params::aliases,
+ $aliases_file = $bash::params::aliases_file,
+ $ensure = $bash::params::ensure,
+ $dotfiles_provider = $bash::params::dotfiles_provider,
+ $dotfiles_src = $bash::params::dotfiles_src,
+ $dotfiles_revision = $bash::params::dotfiles_revision
)
-inherits bash::params
-{
- info ("Configuring bash (with ensure = ${ensure})")
+inherits bash::params {
+ info ("Configuring bash (with ensure = ${ensure})")
- if ! ($ensure in [ 'present', 'absent' ]) {
- fail("bash 'ensure' parameter must be set to either 'absent' or 'present'")
- }
+ if ! ($ensure in ['present', 'absent']) {
+ fail("bash 'ensure' parameter must be set to either 'absent' or 'present'")
+ }
- case $facts['os']['family'] {
- 'Debian': { include bash::common::debian }
- 'Redhat': { include bash::common::redhat }
- default: {
- fail("Module ${module_name} is not supported on ${facts['os']['name']}")
- }
+ case $facts['os']['family'] {
+ 'Debian': { include bash::common::debian }
+ 'Redhat': { include bash::common::redhat }
+ default: {
+ fail("Module ${module_name} is not supported on ${facts['os']['name']}")
}
+ }
}
-
-
-
diff --git a/manifests/params.pp b/manifests/params.pp
index 7b4944f..ce891a5 100644
--- a/manifests/params.pp
+++ b/manifests/params.pp
@@ -23,7 +23,6 @@
# [Remember: No empty lines between comments and class definition]
#
class bash::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 '')
@@ -37,7 +36,6 @@
$dotfiles_src = 'https://github.com/ULHPC/dotfiles.git'
$dotfiles_revision = 'master'
-
#### MODULE INTERNAL VARIABLES #########
# (Modify to adapt to unsupported OSes)
#######################################
@@ -48,7 +46,7 @@
$extra_packages = $facts['os']['name'] ? {
#/(?i-mx:ubuntu|debian)/ => [],
#/(?i-mx:centos|fedora|redhat)/ => [],
- default => [ 'bash-completion' ]
+ default => ['bash-completion']
}
### Configuration directory & file
@@ -66,7 +64,6 @@
# $bash_completion_src_url = "http://bash-completion.alioth.debian.org/files/bash-completion-2.0.tar.gz"
# $bash_completion_src_version = "2.0"
-
# Configuration directory & file
$configdir = $facts['os']['name'] ? {
default => '/etc/bashrc.d',
@@ -105,7 +102,4 @@
}
$configfile_group = $facts['os']['name'] ? {
default => 'root',
- }
-
-
-}
+} }
diff --git a/manifests/setup.pp b/manifests/setup.pp
index 93efe3e..eb8dcdd 100644
--- a/manifests/setup.pp
+++ b/manifests/setup.pp
@@ -67,82 +67,75 @@
# [Remember: No empty lines between comments and class definition]
#
define bash::setup (
- $path = '',
- $ensure = 'present',
- $user = 'root',
- $group = 'root'
-)
-{
- if ! ($ensure in [ 'present', 'absent' ]) {
- fail("bash::setup 'ensure' parameter must be set to either 'absent' or 'present'")
- }
+ $path = '',
+ $ensure = 'present',
+ $user = 'root',
+ $group = 'root'
+) {
+ if ! ($ensure in ['present', 'absent']) {
+ fail("bash::setup 'ensure' parameter must be set to either 'absent' or 'present'")
+ }
- include bash::params
+ include bash::params
- if !defined(Class['bash']) {
- include 'bash'
- }
+ if !defined(Class['bash']) {
+ include 'bash'
+ }
- # Where to install .bashrc etc.
- $basedir = $path ? {
- '' => $name,
- default => $path
- }
+ # Where to install .bashrc etc.
+ $basedir = $path ? {
+ '' => $name,
+ default => $path
+ }
- if ($basedir == '') {
- fail('Unable to run bash::setup in an empty directory')
- }
+ if ($basedir == '') {
+ fail('Unable to run bash::setup in an empty directory')
+ }
+
+ # Let's go
+ info("Running ${module_name}::setup in ${basedir} for user ${user} (with ensure = ${ensure})")
+ $install_script = "${basedir}/${bash::params::dotfilesdir}/install.sh"
+ $install_script_options = '--offline --bash --screen'
- # Let's go
- info("Running ${module_name}::setup in ${basedir} for user ${user} (with ensure = ${ensure})")
- $install_script = "${basedir}/${bash::params::dotfilesdir}/install.sh"
- $install_script_options = '--offline --bash --screen'
+ # Set File / Exec resource defaults
+ File {
+ owner => $user,
+ group => $group,
+ }
+ Exec {
+ user => $user,
+ group => $group,
+ }
- # Set File / Exec resource defaults
- File {
- owner => $user,
- group => $group,
+ if ($ensure == 'present') {
+ file { "${basedir}/${bash::params::dotfilesdir}":
+ ensure => 'link',
+ target => $bash::ref_dotfilesdir,
+ require => Vcsrepo[$bash::ref_dotfilesdir],
}
- Exec {
- user => $user,
- group => $group,
+ # Now call the install script
+ exec { $install_script:
+ path => '/usr/bin:/usr/sbin:/bin:/sbin',
+ command => "${install_script} --dir '${basedir}/${bash::params::dotfilesdir}' ${install_script_options}",
+ cwd => $basedir,
+ onlyif => "test -x ${install_script}",
+ unless => "test -h ${basedir}/.bashrc",
+ require => File["${basedir}/${bash::params::dotfilesdir}"],
}
+ }
+ else {
+ $remove_cmd = "${install_script} --delete --dir '${basedir}/${bash::params::dotfilesdir}' ${install_script_options}"
- if ($ensure == 'present')
- {
-
- file { "${basedir}/${bash::params::dotfilesdir}":
- ensure => 'link',
- target => $bash::ref_dotfilesdir,
- require => Vcsrepo[$bash::ref_dotfilesdir],
- }
- # Now call the install script
- exec { $install_script:
- path => '/usr/bin:/usr/sbin:/bin:/sbin',
- command => "${install_script} --dir '${basedir}/${bash::params::dotfilesdir}' ${install_script_options}",
- cwd => $basedir,
- onlyif => "test -x ${install_script}",
- unless => "test -h ${basedir}/.bashrc",
- require => File["${basedir}/${bash::params::dotfilesdir}"],
- }
+ # Now call the install script
+ exec { $remove_cmd:
+ path => '/usr/bin:/usr/sbin:/bin:/sbin',
+ cwd => $basedir,
+ onlyif => "test -x ${install_script}",
+ require => Vcsrepo[$bash::ref_dotfilesdir],
}
- else
- {
- $remove_cmd = "${install_script} --delete --dir '${basedir}/${bash::params::dotfilesdir}' ${install_script_options}"
-
- # Now call the install script
- exec { $remove_cmd:
- path => '/usr/bin:/usr/sbin:/bin:/sbin',
- cwd => $basedir,
- onlyif => "test -x ${install_script}",
- require => Vcsrepo[$bash::ref_dotfilesdir],
- }
- file { "${basedir}/${bash::params::dotfilesdir}":
- ensure => $ensure,
- require => Exec[$remove_cmd],
- }
+ file { "${basedir}/${bash::params::dotfilesdir}":
+ ensure => $ensure,
+ require => Exec[$remove_cmd],
}
-
-
-}
+} }
diff --git a/metadata.json b/metadata.json
index aa0a6d6..40da181 100644
--- a/metadata.json
+++ b/metadata.json
@@ -2,15 +2,11 @@
"name": "ULHPC-bash",
"version": "0.8.0",
"author": "UL HPC Team",
- "mail": "hpc-sysadmins@uni.lu",
"summary": "Configure and manage Bourne Again SHell (Bash) dotfiles and profiles",
- "description": "Configure and manage Bourne Again SHell (Bash) dotfiles and profile.\r\n Bourne Again SHell (Bash) is the GNU Project's shell. Bash is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. It offers functional improvements over sh for both programming and interactive use. In addition, most sh scripts can be run by Bash without modification.",
"license": "Apache-2.0",
"source": "https://github.com/ULHPC/puppet-bash",
- "docs_project": "ulhpc-puppet-bash",
"project_page": "https://github.com/ULHPC/puppet-bash",
"issues_url": "https://github.com/ULHPC/puppet-bash/issues",
- "forge_url": "https://forge.puppetlabs.com/ULHPC/bash",
"dependencies": [
{
"name": "puppetlabs-stdlib",
@@ -29,49 +25,48 @@
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
- "6",
- "7"
+ "11",
+ "12",
+ "13"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
- "6",
"7",
"8",
- "9"
+ "9",
+ "10"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
- "6",
"7",
- "8"
+ "8",
+ "9",
+ "10"
]
},
{
"operatingsystem": "Rocky",
"operatingsystemrelease": [
"8",
- "9"
+ "9",
+ "10"
]
}
],
+ "requirements": [
+ {
+ "name": "puppet",
+ "version_requirement": ">= 8.0.0 < 9.0.0"
+ }
+ ],
"tags": [
"shell",
"gnu",
"bash"
- ],
- "classes": [
- "bash",
- "bash::common",
- "bash::common::debian",
- "bash::common::redhat",
- "bash::params"
- ],
- "definitions": [
- "bash::config",
- "bash::setup"
]
-}
\ No newline at end of file
+}
+
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 }
diff --git a/tests/absent.pp b/tests/absent.pp
deleted file mode 100644
index aae1a6e..0000000
--- a/tests/absent.pp
+++ /dev/null
@@ -1,22 +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/absent.pp
-#
-node default {
- class { 'bash':
- ensure => 'absent',
- }
-}
diff --git a/tests/config.pp b/tests/config.pp
deleted file mode 100644
index 3f85bf2..0000000
--- a/tests/config.pp
+++ /dev/null
@@ -1,31 +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
-#
-#
-#
-#
-# You can execute this manifest as follows in your vagrant box
-#
-# sudo puppet apply -t /vagrant/tests/config.pp
-#
-node default {
- include bash
-
- bash::config{ 'sysadminrc':
- ensure => 'present',
- warn => true,
- content => "
-# Load .sysadminrc if present
-if [ -f ~/.sysadminrc ]; then
- . ~/.sysadminrc
-fi",
- }
-
-}
diff --git a/tests/config_vagrant.pp b/tests/config_vagrant.pp
deleted file mode 100644
index eff9af2..0000000
--- a/tests/config_vagrant.pp
+++ /dev/null
@@ -1,52 +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
-#
-#
-#
-#
-# You can execute this manifest as follows in your vagrant box
-#
-# sudo puppet apply -t /vagrant/tests/config_vagrant.pp
-#
-node default {
- include bash
-
- Bash::Config {
- ensure => 'present',
- warn => true,
- rootdir => '/home/vagrant',
- owner => 'vagrant',
- group => 'vagrant',
- }
-
- bash::config{ 'aliases':
- content => "
-# Local aliases
-alias cdv='cd /vagrant'
-",
- }
-
- bash::config{ 'prompts':
- content => '
-# Local aliases
-export PS1="\u@\h \w>"
-',
- }
-
- bash::config{ 'sysadminrc':
- before_hook => true,
- content => "
-# Load .sysadminrc if present
-if [ -f ~/.sysadminrc ]; then
- . ~/.sysadminrc
-fi",
- }
-
-}
diff --git a/tests/init.pp b/tests/init.pp
deleted file mode 100644
index 9c34f4c..0000000
--- a/tests/init.pp
+++ /dev/null
@@ -1,19 +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
-#
-#
-#
-# You can execute this manifest as follows in your vagrant box
-#
-# sudo puppet apply -t /vagrant/tests/init.pp
-#
-node default {
- include bash
-}
diff --git a/tests/params.pp b/tests/params.pp
deleted file mode 100644
index f48ff43..0000000
--- a/tests/params.pp
+++ /dev/null
@@ -1,28 +0,0 @@
-# File:: params.pp
-# Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team (hpc-sysadmins@uni.lu)
-# Copyright:: Copyright (c) 2015 S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team
-# License:: Apache-2.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 'bash::params'
-
-$names = ['ensure', 'protocol', 'port', 'packagename']
-
-notice("bash::params::ensure = ${bash::params::ensure}")
-notice("bash::params::protocol = ${bash::params::protocol}")
-notice("bash::params::port = ${bash::params::port}")
-notice("bash::params::packagename = ${bash::params::packagename}")
-
-#each($names) |$v| {
-# $var = "bash::params::${v}"
-# notice("${var} = ", inline_template('<%= scope.lookupvar(@var) %>'))
-#}
diff --git a/tests/setup_vagrant.pp b/tests/setup_vagrant.pp
deleted file mode 100644
index 48b9e69..0000000
--- a/tests/setup_vagrant.pp
+++ /dev/null
@@ -1,27 +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
-#
-#
-#
-#
-# You can execute this manifest as follows in your vagrant box
-#
-# sudo puppet apply -t /vagrant/tests/setup_vagrant.pp
-#
-node default {
- include bash
-
- bash::setup{ '/home/vagrant':
- ensure => 'present',
- user => 'vagrant',
- group => 'vagrant',
- }
-
-}
diff --git a/tests/setup_vagrant_absent.pp b/tests/setup_vagrant_absent.pp
deleted file mode 100644
index 8158104..0000000
--- a/tests/setup_vagrant_absent.pp
+++ /dev/null
@@ -1,28 +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
-#
-#
-# You can execute this manifest as follows in your vagrant box
-#
-# sudo puppet apply -t /vagrant/tests/setup_vagrant_absent.pp
-#
-# This specific manifest remove the setup of bash operated by the ULHPC/bash module
-# for the 'vagrant' user
-#
-node default {
- include bash
-
- bash::setup{ '/home/vagrant':
- ensure => 'absent',
- user => 'vagrant', # Ensure you are running as the owner user of the homedir
- group => 'vagrant',
- }
-
-}
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})