biemond / biemond-orawls

Puppet 3/4 module for WebLogic provisioning module ( Linux & Solaris )
Apache License 2.0
63 stars 104 forks source link

wls_group requires a 'users' parameter when ensuring a group as absent #213

Open sacchettom opened 9 years ago

sacchettom commented 9 years ago

When instanciating a wls_group with ensure => 'absent' a users parameter is still needed even if not used. With Hyera:

group_instances:
    'Administrator':
      ensure:                 'absent'
      realm:                  'myrealm'
      authenticationprovider: 'DefaultAuthenticator'
      users: []

Works. This won't work:

    group_instances:
      'Administrator':
        ensure:                 'absent'
        realm:                  'myrealm'
        authenticationprovider: 'DefaultAuthenticator'

Error when running the non working code with puppet agent -t --debug --trace

Error: Failed to apply catalog: undefined method `collect' for nil:NilClass
/opt/puppetlabs/puppet/cache/lib/puppet/type/wls_group/users.rb:26:in `block in include_file'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2053:in `instance_eval'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2053:in `block in autorelation'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1992:in `block in eachautorequire'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1991:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:1991:in `eachautorequire'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2048:in `autorelation'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type.rb:2078:in `autorequire'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:169:in `block (2 levels) in build_autorelation_dependencies'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:168:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:168:in `block in build_autorelation_dependencies'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:167:in `each'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:167:in `build_autorelation_dependencies'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/graph/relationship_graph.rb:25:in `populate_from'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:202:in `relationship_graph'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:171:in `relationship_graph'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction.rb:82:in `evaluate'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:178:in `block in apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/log.rb:153:in `with_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/transaction/report.rb:107:in `as_logging_destination'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/resource/catalog.rb:177:in `apply'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:119:in `block in apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:129:in `block in benchmark'
/opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:128:in `benchmark'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:118:in `apply_catalog'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:228:in `run_internal'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:134:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:64:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:223:in `override'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:133:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:48:in `block (4 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent/locker.rb:20:in `lock'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:48:in `block (3 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:98:in `with_client'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:45:in `block (2 levels) in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:65:in `run_in_fork'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:44:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:179:in `call'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:179:in `controlled_run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:42:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/agent.rb:351:in `onetime'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/agent.rb:328:in `run_command'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:344:in `block in run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:446:in `exit_on_fail'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:344:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:128:in `run'
/opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
/opt/puppetlabs/puppet/bin/puppet:5:in `<main>'

Running Puppet 4.2.1 and Hiera 3.0.1 on Centos 6.6.

biemond commented 9 years ago

Thanks

I fixed it in this commit 65471f1 Can you check if it works for you.

Cheers Edwin

sacchettom commented 9 years ago

Thanks Edwin, tested and confirmed working. I'm leaving the issue open, so that you can close it once the commit is merged to the master branch. May I suggest that you use the commit messages in order to autoclose issues as per https://help.github.com/articles/closing-issues-via-commit-messages/ ? Looks very convenient!

Cheers Marco