From 06836952be687c5f5b7895e4f67f91dc0e01ff6a Mon Sep 17 00:00:00 2001 From: Serg Shevchenko Date: Fri, 6 May 2022 11:40:57 -0700 Subject: [PATCH] Fix bug with Puppet restarting Nexus on each run Puppet toggles user and group on the configuration file back and forth and restarts Nexus service. Set correct owner and group on the config file so this does not happen. --- manifests/config.pp | 4 ++++ manifests/init.pp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/manifests/config.pp b/manifests/config.pp index 0f88c26..9fe8d4e 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -26,6 +26,8 @@ $nexus_context = $::nexus::nexus_context, $nexus_work_dir = $::nexus::nexus_work_dir, $nexus_data_folder = $::nexus::nexus_data_folder, + $nexus_user = $::nexus::nexus_user, + $nexus_group = $::nexus::nexus_group, $version = $::nexus::version, ) { @@ -47,6 +49,8 @@ # Nexus >=3.x do no necesarily have a properties file in place to # modify. Make sure that there is at least a minmal file there file { $nexus_properties_file: + owner => $nexus_user, + group => $nexus_group, ensure => present, } diff --git a/manifests/init.pp b/manifests/init.pp index fd90c5b..722075e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -126,6 +126,8 @@ nexus_context => $nexus_context, nexus_work_dir => $real_nexus_work_dir, nexus_data_folder => $nexus_data_folder, + nexus_user => $nexus_user, + nexus_group => $nexus_group, notify => Class['nexus::service'], require => Anchor['nexus::setup'] }