From ae9267612fe0ba4ddfb92271f21568d38ceee102 Mon Sep 17 00:00:00 2001 From: mikpe74 <mika.perala@liu.se> Date: Wed, 7 Sep 2022 14:48:53 +0200 Subject: [PATCH] PDK update - switch to letsencrypt - correct PDK errors - dont use runserver --- .devcontainer/README.md | 8 ++++++-- .rubocop.yml | 2 +- Gemfile | 1 + manifests/init.pp | 20 ++++++++++---------- manifests/python.pp | 6 +++--- manifests/runserver.pp | 7 ++++--- manifests/yarn.pp | 3 ++- metadata.json | 4 ++-- 8 files changed, 29 insertions(+), 22 deletions(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index cc4675e..a719361 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -13,14 +13,18 @@ https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/pupp // 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": [], diff --git a/.rubocop.yml b/.rubocop.yml index 8f782e7..31e8248 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 18272fd..b806b3e 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/manifests/init.pp b/manifests/init.pp index 464024b..a01f558 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,28 +4,31 @@ # # @example # include tracingcarbon -class tracingcarbon { +class tracingcarbon ( +) { + include profiles::letsencrypt + firewalld_service { 'Allow SSH in the liu zone': ensure => present, zone => 'liu', service => 'ssh', } - firewalld_service {'Allow http in the liu Zone': + firewalld_service { 'Allow http in the liu Zone': ensure => present, zone => 'liu', service => 'http', } - firewalld_service {'Allow https in the liu Zone': + firewalld_service { 'Allow https in the liu Zone': ensure => present, zone => 'liu', service => 'https', } - firewalld_service {'Allow http in the public Zone': + firewalld_service { 'Allow http in the public Zone': ensure => present, zone => 'public', service => 'http', } - firewalld_service {'Allow https in the public Zone': + firewalld_service { 'Allow https in the public Zone': ensure => present, zone => 'public', service => 'https', @@ -36,10 +39,7 @@ class tracingcarbon { sshkey => 'AAAAB3NzaC1yc2EAAAADAQABAAABAQDHsZ1q+e4nD2SAx659Kv1vf3tmhQmQJ/KOe4zOk4FyJt2OUoHsv82RD4rYVXxcnGojwFjTAtYTW2B4q/f334IGY9aezow/b39kkg977bJ7AC/OU1enkWFK3nkDtkP7htVbsSeogvyHf32niyosDvW8VCTNe9DZctyJ5Eu9AB0z/tuAr++/z+9sWYtiG0sGn/rUnrAvOqWHkTR2ShZHZPyXq+UCrJXHfbJ+P9EzzgFjr2uPoFgBiCqd0Ov2/zWP3k+chGcbSSKtJ3I3Ylh49jAxB1/srct4R0o7sNOKQBnrXXTAIkDLma2ilu0dAksPjD22ZYvWgRt03u7qxQR6lOB/', #lint:ignore:140chars } - include certdist - include tracingcarbon::python - # include tracingcarbon::yarn - - include tracingcarbon::runserver + #include tracingcarbon::yarn + #include tracingcarbon::runserver } diff --git a/manifests/python.pp b/manifests/python.pp index 74a6b5e..09f8763 100644 --- a/manifests/python.pp +++ b/manifests/python.pp @@ -1,7 +1,7 @@ # Ensures python is installed -class tracingcarbon::python ( ) { - package { 'python39' : +class tracingcarbon::python ( +) { + package { 'python39': ensure => 'installed', } - } diff --git a/manifests/runserver.pp b/manifests/runserver.pp index 822e634..ae0e54c 100644 --- a/manifests/runserver.pp +++ b/manifests/runserver.pp @@ -1,8 +1,9 @@ # Starts the django server in a pipenv, if not already running -class tracingcarbon::runserver () { - exec { 'Run django' : +class tracingcarbon::runserver ( +) { + exec { 'Run django': command => 'npm run build && pipenv run python3 manage.py migrate && pipenv run python3 manage.py runserver &', - path => [ '/home/mange61/.local/bin', '/usr/bin', '/bin' ], + path => ['/home/mange61/.local/bin', '/usr/bin', '/bin'], cwd => '/home/mange61/tracing-carbon', user => 'mange61', unless => 'nc localhost 8000 -w 1', diff --git a/manifests/yarn.pp b/manifests/yarn.pp index a15cbb4..56339c5 100644 --- a/manifests/yarn.pp +++ b/manifests/yarn.pp @@ -1,5 +1,6 @@ # Ensures yarn is installed -class tracingcarbon::yarn ( ) { +class tracingcarbon::yarn ( +) { package { 'nodejs' : ensure => 'installed', } diff --git a/metadata.json b/metadata.json index 228900b..ea16288 100644 --- a/metadata.json +++ b/metadata.json @@ -40,7 +40,7 @@ "version_requirement": ">= 6.21.0 < 8.0.0" } ], - "pdk-version": "2.4.0", + "pdk-version": "2.5.0", "template-url": "https://gitlab.it.liu.se/puppet-infra/pdk-templates.git#liu", - "template-ref": "heads/liu-0-g76c91ed" + "template-ref": "heads/liu-0-gcb718ad" } -- GitLab