From 3874378d038241a4f5adcfdb24bd5535a2ba0195 Mon Sep 17 00:00:00 2001 From: Sebastian Reitenbach Date: Thu, 21 Apr 2016 08:22:40 +0200 Subject: [PATCH] Do not hardcode the 'root' group name, use the 'gid' for that. Non-Linux systems, i.e. *BSD might not have a group 'root', but have group wheel. What is in common everywhere is the 'gid' of these groups is '0'. Setting the group => '0' instead of group => 'root' is a common pattern seen in many other modules. This fixes the setting of the group for the npmrc file. For consistency, I also changed the group in manifests/repo/nodesource/yum.pp even it doesn't affect me. Ran into the problem on OpenBSD. --- manifests/install.pp | 2 +- manifests/repo/nodesource/yum.pp | 2 +- spec/classes/nodejs_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/install.pp b/manifests/install.pp index 1675d874..ac73ad68 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -64,7 +64,7 @@ path => '/root/.npmrc', content => template('nodejs/npmrc.erb'), owner => 'root', - group => 'root', + group => '0', mode => '0600', } } diff --git a/manifests/repo/nodesource/yum.pp b/manifests/repo/nodesource/yum.pp index a6f9688d..51937c2b 100644 --- a/manifests/repo/nodesource/yum.pp +++ b/manifests/repo/nodesource/yum.pp @@ -48,7 +48,7 @@ file { '/etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL': ensure => file, - group => 'root', + group => '0', mode => '0644', owner => 'root', source => "puppet:///modules/${module_name}/repo/nodesource/NODESOURCE-GPG-SIGNING-KEY-EL", diff --git a/spec/classes/nodejs_spec.rb b/spec/classes/nodejs_spec.rb index 644a7a26..f76ef7be 100644 --- a/spec/classes/nodejs_spec.rb +++ b/spec/classes/nodejs_spec.rb @@ -51,7 +51,7 @@ 'ensure' => 'file', 'path' => '/root/.npmrc', 'owner' => 'root', - 'group' => 'root', + 'group' => '0', 'mode' => '0600', ) end