-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot alias Shellvar, resource already declared #31
Comments
Maybe this helps. It seems like (at least with EDIT: Otherwise I think the only solution is go the way of puppetlabs-inifile#subsetting and introduce a new (namevar-) parameter |
I'm not really sure to understand how switching the In any case:
Mainly, I can't reproduce this either on Puppet 4.10 or 5.5. Which version of Puppet are you using? |
Oh ok, thanks you for clearing this confusion. I thought this is the intended use-case, similar to puppetlabs-inifile
This happened with Puppet 4.10. Since I was able to solve this using hercules-team/augeasproviders_grub instead and given your above explanation I think we can close this issue as it seems to be the intended behavior. |
Running into this exact same problem now with Puppet 6.27.0 and augeasproviders_shellvar v5.0.0. 😒 I'm even trying to set the same variable in the same file as the original reporter, It's starting to look like I might need to use Update: turns out that Eventually I think this problem will go away for |
Silly workaround, but it seems to work fine: add extra slashes to the shellvar { 'wanted kernel parameters':
ensure => present,
variable => 'GRUB_CMDLINE_LINUX',
target => '/etc/default//grub',
value => [
'audit=1',
],
array_append => true,
notify => Exec['update-grub'],
}
shellvar { 'unwanted kernel parameters':
ensure => absent,
variable => 'GRUB_CMDLINE_LINUX',
target => '/etc/default/grub',
value => [
'nomodeset',
'quiet',
'splash',
],
array_append => true,
notify => Exec['update-grub'],
} |
Got the same issue with puppet 8.5.1 and this very small patch fixed on my side: diff --git a/lib/puppet/type/shellvar.rb b/lib/puppet/type/shellvar.rb
index 70c99c6..97378ae 100644
--- a/lib/puppet/type/shellvar.rb
+++ b/lib/puppet/type/shellvar.rb
@@ -55,6 +55,7 @@ Puppet::Type.newtype(:shellvar) do
newparam(:name) do
desc 'The default namevar'
+ isnamevar
end
newparam(:variable) do This is added in that PR: #61 |
The following code works fine with version 2.2.2, but fails with catalog-compilation error on version 2.2.3.
Error message:
The text was updated successfully, but these errors were encountered: