Closed cfrantsen closed 7 years ago
The proper JBoss-CLI syntax to add this resource is: /subsystem=naming/binding="java:global/ldap/bmx":add()
(i.e. you need to quote the value)
I changed to it, tried to apply, but it turns out the request should be cleaning this value before submitting it. A simple gsub('"', '')
at line 37 of CLICommand
was enough to pass.
So, I'll add a spec for this scenario, fix the code and release it as soon as I can.
Thanks for your time. Your report will improve this module. :+1:
Just pushed to master. Could you test it?
Tried master with the following syntax, but still get an error.
wildfly_resource { "/subsystem=naming/binding=\"${name}\"":
/Wildfly_resource[/subsystem=naming/binding="java:global/ldap/bmk"]: Could not evaluate: undefined method `elements' for nil:NilClass
My bad. I thought you're using wildfly::resource
, but you're using wildfly_resource
.
Here is what you can do temporarily:
wildfly_resource { '/subsystem=naming/binding=java:global/ldap/bmk':
username => 'puppet',
password => 'puppet',
host => '127.0.0.1',
port => '9990',
path => '/subsystem=naming/binding="java:global/ldap/bmk"',
state => {
'binding-type' => 'external-context',
'cache' => false,
'class' => 'javax.naming.directory.InitialDirContext',
'module' => 'org.jboss.as.naming',
'environment' => {
'java.naming.factory.initial' => 'com.sun.jndi.ldap.LdapCtxFactory',
'java.naming.provider.url' => 'ldap://',
'java.naming.security.authentication' => 'simple',
'java.naming.security.principal' => 'abc',
'java.naming.security.credentials' => 'abc',
'com.sun.jndi.ldap.connect.pool' => true,
},
}
}
The problem is that wildfly_resource
uses a composite namevar path:host:port
to allow management of multiple instances from a single Puppet node, but it's conflicting with java:global
, so, you have to override path, host and port
in order to make it work.
I'l give this a try when I get to the office tomorrow. Thanks!
Works great when using explicit path, thanks.
I'm trying to create a naming context like this, where name is
java:global/ldap/bmk
This results in the following error:
So I try to escape the colon and slashes in the name using
regsubst($name, '(/|:)', '\\\1', 'G')
but then I get this error instead:This used to work in earlier versions (0.5 something) but stopped working when I tried upgrading to the newest one. It looks to be related to #177.
Any suggestions on how I can get this working?