diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a719361689897b67e53c12da1c50e68c5b8c7dc8 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,38 @@ +# devcontainer + + +For format details, see https://aka.ms/devcontainer.json. + +For config options, see the README at: +https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet + +``` json +{ + "name": "Puppet Development Kit (Community)", + "dockerFile": "Dockerfile", + + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.profiles.linux": { + "bash": { + "path": "bash", + } + } + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "puppet.puppet-vscode", + "rebornix.Ruby" + ], + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "pdk --version", +} +``` + + + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f1a55dc3f0acb1031982196149da8edcb1a2d6ef..fe7a8b12b998dab13c95cce183eec95e387ae6bc 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,23 +1,17 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet { "name": "Puppet Development Kit (Community)", "dockerFile": "Dockerfile", - // Set *default* container specific settings.json values on container create. "settings": { - "terminal.integrated.shell.linux": "/bin/bash" + "terminal.integrated.profiles.linux": { + "bash": { + "path": "bash", + } + } }, - // Add the IDs of extensions you want installed when the container is created. "extensions": [ "puppet.puppet-vscode", "rebornix.Ruby" ] - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "pdk --version", } diff --git a/.rubocop.yml b/.rubocop.yml index 8f782e741528905cd59743f73283f8a39e9bf210..31e8248ff813e956702d5c67844aeb0e2affc917 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ require: - rubocop-rspec AllCops: DisplayCopNames: true - TargetRubyVersion: '2.4' + TargetRubyVersion: '2.5' Include: - "**/*.rb" Exclude: diff --git a/Gemfile b/Gemfile index 18272fd72e8b95feb3fe64e34a51a9b75a7af794..b806b3edb7243ad4311b3162ab008cfa7911c3bc 100644 --- a/Gemfile +++ b/Gemfile @@ -24,6 +24,7 @@ group :development do gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "voxpupuli-puppet-lint-plugins", '>= 3.0', require: false gem "puppet-lint-absolute_classname-check", '3.0.1', require: false gem "puppet-lint-absolute_template_path", '1.0.1', require: false gem "puppet-lint-empty_trailing_lines", '0.0.1', require: false diff --git a/Rakefile b/Rakefile index 2906c15babbebe65d3ed29e72a07328609fefe8e..0f8754eb61e400db1d117cad5026f06d3ba6ff89 100644 --- a/Rakefile +++ b/Rakefile @@ -43,6 +43,7 @@ end PuppetLint.configuration.send('disable_relative') + if Bundler.rubygems.find_name('github_changelog_generator').any? GitHubChangelogGenerator::RakeTask.new :changelog do |config| raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? diff --git a/manifests/init.pp b/manifests/init.pp index 6accab68921d95bb3ccd4f998f065ab8b04203a7..2d013012716fcf8e37c137ae61981b0fc5cfa914 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -26,7 +26,7 @@ # # Copyright 2019 Linköping University # -class egg( +class egg ( ) { ::server_firewall::rules_file { '30-permit_http_https.rules': content => epp("${module_name}/permit_http_https.rules.epp", { diff --git a/metadata.json b/metadata.json index 5356f1f295337ae1c610608587de931fab6b8031..108419d04bf0842fa7d7a1692939aea5634be8ab 100644 --- a/metadata.json +++ b/metadata.json @@ -64,7 +64,7 @@ "version_requirement": ">= 5.5.10 < 6.0.0" } ], - "pdk-version": "2.2.0", + "pdk-version": "2.5.0", "template-url": "https://gitlab.it.liu.se/puppet-infra/pdk-templates.git#liu", - "template-ref": "heads/liu-0-gd8925d4" + "template-ref": "heads/liu-0-gcb718ad" } diff --git a/tests/init.pp b/tests/init.pp deleted file mode 100644 index bd276f8538886238c852bda18fcc776631d2ba4a..0000000000000000000000000000000000000000 --- a/tests/init.pp +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8; -*- - -# 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: -# https://docs.puppetlabs.com/guides/tests_smoke.html - - -# This comment marks the beginning of example usage. - -# Use the manifest we're testing itself here: -include egg - -# Nota bene: You can not control the order in which the external node -# classifier applies classes so your manifests need to work even when -# dependencies are applied after the resources that depend on them. - -# Include required modules here: - -# This comment marks the end of example usage. - - -# Most manifests created in pm-liuit will use some Nagios and -# Server_firewall defines so their dependencies will need to be -# loaded. We don't want to do that in the manifests however as those -# classes should be applied by the external node classifier in -# production. - -# Test environment dependencies: -include yum -include yum::epel -include nagios::node - -# Simulate properly set up firewall: -class { 'server_firewall': - constricto_available => true, - constricto_enabled => true, -} - -# Declare required resources here: -service { [ 'network', 'rsyslog', ]: -}