Closed PierreR closed 9 years ago
What does it do when you replace with defined(Class['nginx::config'])
(without the ::
header) ?
It tried it and got:
ERROR: (a.b) Override of parameters of the following resource is forbidden in the current context:
class {
nginx::params: # "/tmp/x/manifests/site.pp" (line 4, column 11) a.b [Scope []]
;
} # "/tmp/x/modules/nginx/manifests/config.pp" (line 202, column 5) at # "/tmp/x/modules/nginx/manifests/config.pp" (line 287, column 10)
Isn't it better now ? Class reference names are now normalized.
I am going to try later today.
I was planning to describe in more detail the problem I have with global scoping but I haven't found the time yet. Yesterday for instance I was writing something such as require => Class['profile::mycompany']
where profile is an external module. In that case require => Class['profile::mycompany']
was working but require => Class['::profile::mycompany']
was not. I would have expected the completely opposite behavior.
I have to read the puppet doc again about global scoping but to me all the current practices in puppetlabs modules seems wrong. Isn't ::
only useful when you want to start from the root of the module path ? So for instance to call an external postgresql
class inside an apache one.
Hopefully both cases should work now !
Work nicely so far. I am closing the issue. Thanks
Given this code and the following declaration:
defined(Class['::nginx::config']) return
false
while it should betrue
.See this issue
I guess this might be horrible to fix ...