From bc4f1b3ed01c1876ea9d08442b6333d080d348dd Mon Sep 17 00:00:00 2001 From: Andrew Seales Date: Mon, 16 Jan 2023 12:06:48 +0000 Subject: [PATCH] Fix for permission denied with registry When using `local_user` when creating registry credentials, puppet would fail with a permission denied error. When `local_user` was specified, it seems that the `docker login` command would use the incorrect home directory of the specified user. Making sure the `HOME` environment variable was set fixes the problem. --- manifests/registry.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/registry.pp b/manifests/registry.pp index 53524be7..ccca7eff 100644 --- a/manifests/registry.pp +++ b/manifests/registry.pp @@ -58,7 +58,6 @@ $password_env = '$env:password' $exec_user = undef } else { - $exec_environment = [] $exec_path = ['/bin', '/usr/bin',] $exec_timeout = 0 $exec_provider = undef @@ -73,6 +72,7 @@ default => "/home/${local_user}", } } + $exec_environment = ["HOME=$_local_user_home",] } if $ensure == 'present' {