From 4539d901837fb5128408dad9c49d9d356b25fb3e Mon Sep 17 00:00:00 2001 From: Martin Alfke Date: Tue, 9 Jan 2024 16:53:53 +0100 Subject: [PATCH 1/3] Add missing env variables for container When we switched the container to make use of another port we forgot to update the module. --- manifests/docker.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/docker.pp b/manifests/docker.pp index a321032..d04f25e 100644 --- a/manifests/docker.pp +++ b/manifests/docker.pp @@ -61,6 +61,8 @@ "TZ=${$hdm::timezone}", "RAILS_DEVELOPMENT_HOSTS=${hdm::hostname}", "SECRET_KEY_BASE=${hdm::secret_key_base}", + "HDM_PORT=${hdm::port}", + "HDM_HOST=${hdm::hostname}", ], volumes => [ "${hdm::hdm_path}:${hdm::hdm_path}", From 552587024a921cf06be09089e8b3dc032714b3f5 Mon Sep 17 00:00:00 2001 From: Martin Alfke Date: Wed, 10 Jan 2024 10:44:47 +0100 Subject: [PATCH 2/3] Set hostname and port and allow own registry We want to allow using different ports and hostnames. We pass these information as arguments to the docker container. A user wants to make use of a local registry. Adding a parameter to hdm calls to set individual registry. --- manifests/docker.pp | 4 ++-- manifests/init.pp | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/manifests/docker.pp b/manifests/docker.pp index d04f25e..54d176b 100644 --- a/manifests/docker.pp +++ b/manifests/docker.pp @@ -51,12 +51,12 @@ ensure => file, } - docker::image { 'ghcr.io/betadots/hdm': + docker::image { $hdm::container_registry_url: image_tag => $hdm::version, } docker::run { 'hdm': - image => "ghcr.io/betadots/hdm:${hdm::version}", + image => "${hdm::container_registry_url}:${hdm::version}", env => [ "TZ=${$hdm::timezone}", "RAILS_DEVELOPMENT_HOSTS=${hdm::hostname}", diff --git a/manifests/init.pp b/manifests/init.pp index 5778eb5..1da960d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -19,6 +19,9 @@ # the git tag when using rvm # Please find the releases on HDM website: https://github.com/betadots/hdm/releases # +# @param container_registry_url Configure another registry. Contains the host, path and container name. The version is set via the version parameter. +# e.g. ghcr.io/betadots/hdm +# # @param ruby_version Select the ruby version when installing using rvm # Please check [hdm ruby version requirement](https://github.com/betadots/hdm/blob/main/.ruby-version) # @@ -122,6 +125,7 @@ # installation parameter String[1] $version = '1.0.1', Enum['docker', 'rvm'] $method = 'docker', + String[1] $container_registry_url = 'ghcr.io/betadots/hdm', Boolean $manage_docker = true, String[1] $ruby_version = '3.1.2', # required application parameter From 4c8af38befd144e9164fbb9fd9f3d22dad77877a Mon Sep 17 00:00:00 2001 From: Martin Alfke Date: Wed, 10 Jan 2024 11:04:00 +0100 Subject: [PATCH 3/3] new parameter needs updated reference --- REFERENCE.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/REFERENCE.md b/REFERENCE.md index 5c4a015..5b935c9 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -42,6 +42,7 @@ The following parameters are available in the `hdm` class: * [`method`](#-hdm--method) * [`manage_docker`](#-hdm--manage_docker) * [`version`](#-hdm--version) +* [`container_registry_url`](#-hdm--container_registry_url) * [`ruby_version`](#-hdm--ruby_version) * [`port`](#-hdm--port) * [`bind_ip`](#-hdm--bind_ip) @@ -96,6 +97,15 @@ Please find the releases on HDM website: https://github.com/betadots/hdm/release Default value: `'1.0.1'` +##### `container_registry_url` + +Data type: `String[1]` + +Configure another registry. Contains the host, path and container name. The version is set via the version parameter. +e.g. ghcr.io/betadots/hdm + +Default value: `'ghcr.io/betadots/hdm'` + ##### `ruby_version` Data type: `String[1]`