From cb888aac4b38646a4ea830d36b78786725013aab Mon Sep 17 00:00:00 2001 From: Martin Alfke Date: Thu, 4 Aug 2022 11:30:52 +0200 Subject: [PATCH] Bugfixes (#5) * set hostname from data * timezone * alignment * update version --- .devcontainer/devcontainer.json | 2 +- manifests/docker.pp | 27 ++++++++++++++++++--------- manifests/init.pp | 3 +++ metadata.json | 2 +- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fe7a8b1..cdd65d2 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,7 +5,7 @@ "settings": { "terminal.integrated.profiles.linux": { "bash": { - "path": "bash", + "path": "bash" } } }, diff --git a/manifests/docker.pp b/manifests/docker.pp index 6ff28a1..852f9ec 100644 --- a/manifests/docker.pp +++ b/manifests/docker.pp @@ -12,6 +12,16 @@ include docker } + group { $hdm::group: + ensure => present, + } + + user { $hdm::user: + ensure => present, + gid => $hdm::group, + shell => '/sbin/nologin', + } + $directories = [ $hdm::hdm_path, "${hdm::hdm_path}/certs", @@ -41,20 +51,19 @@ } docker::run { 'hdm': - image => "ghcr.io/betadots/hdm:${hdm::version}", - env => [ - "TZ=${facts['timezone']}", - "RAILS_DEVELOPMENT_HOSTS=${facts['networking']['fqdn']}", + image => "ghcr.io/betadots/hdm:${hdm::version}", + env => [ + "TZ=${$hdm::timezone}", + "RAILS_DEVELOPMENT_HOSTS=${hdm::hostname}", ], - volumes => [ + volumes => [ "${hdm::hdm_path}:${hdm::hdm_path}", "${hdm::puppet_code_dir}:${hdm::puppet_code_dir}:ro", "${hdm::hdm_path}/hdm.yml:/hdm/config/hdm.yml:ro", "${hdm::hdm_path}/database.yml:/hdm/config/database.yml:ro", ], - hostname => $hdm::hostname, - ports => [$hdm::port], - net => 'host', - extra_parameters => ["--user ${hdm::user}:${hdm::group}"], + hostname => $hdm::hostname, + ports => [$hdm::port], + net => 'host', } } diff --git a/manifests/init.pp b/manifests/init.pp index faf452a..8e4572b 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -24,6 +24,8 @@ # # @param hostname The hostname to use # +# @param timezone THe timezone to use when running with docker +# # @param hdm_path Path where one wants to install and configure hdm # # @param git_url The git URL to clone the hdm repo from @@ -113,6 +115,7 @@ Stdlib::Port $port = 3000, Stdlib::IP::Address::Nosubnet $bind_ip = '0.0.0.0', String[1] $hostname = $facts['networking']['fqdn'], + String[1] $timezone = $facts['timezone'], Stdlib::Unixpath $hdm_path = '/etc/hdm', String[1] $user = 'hdm', String[1] $group = 'hdm', diff --git a/metadata.json b/metadata.json index fa0473a..68152b6 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "betadots-hdm", - "version": "1.0.1", + "version": "1.0.2", "author": "betadots GmbH", "summary": "Manage Hiera Data Manager application", "license": "Apache-2.0",