Comments (9)
added @jairojunior to this issue
from puppet-wildfly.
@TronPaul First, I'd like to thank you for taking your time to contribute to this module.
I was investigating this resource using JBoss-CLI and /subsystem=datasources/xa-data-source=XPTO:add()
doesn't support xa-datasource-properties, but xa-data-source add
does.
Unfortunately, wildfly_cli is not ready for this type of command yet, mainly because it's not trivial to convert from CLI syntax to JSON. I'm still trying to gather help for this in wildfly-dev list...
If you need it done quickly, I suggest you work in wildfly_cli to support commands like xa-data-source add --property1=value...
, but in the future I hope we find a way to send plain CLI commands through HTTP API.
Alternatively, we could work on a way to wildfly_resource detect if a hash has any hash inside and build a composite operation for this, i.e.:
wildfly::util::resource { '/subsystem=datasources/xa-data-source=DefaultPool':
content => {
'driver-name' => 'oracle',
'jndi-name' => 'java:/jdbc/DefaultPool',
'operation' => 'add',
'password' => 'password',
'user-name' => 'undef',
'xa-datasource-properties' => {
'url' => 'jdbc:oracle:thin:@DEFA'
}
}
What do you think?
from puppet-wildfly.
@jairojunior I like the second option more in terms of fitting better with the module. I don't know enough about Wildfly's API to say whether or not nested hashes inside operations are allowed in other contexts, similar to
{
"address": [
{
"subsystem": "datasources"
},
{
"xa-data-source": "DefaultPool"
}
],
"driver-name": "oracle",
"jndi-name": "java:/jdbc/DefaultPool",
"operation": "add",
"password": "password",
"user-name": "undef",
"xa-datasource-properties": {
"url": "jdbc:oracle:thin:@DEFA"
}
}
if the above actually worked for xa-datasource-properties.
If you think it's safe enough to make the assumption that nested hashes aren't allowed in Wildfly operation properties, I think I can code up something that takes the key holding the hash xa-datasource-properties
, composes a resource address that includes the attribute name url
, and sets it to the value in the hash in a composite action.
Sound good?
from puppet-wildfly.
@TronPaul we already have I use case for this type of declaration (nested hashes), see: https://github.com/biemond/biemond-wildfly/blob/master/manifests/standalone/modcluster/config.pp
We are able to handle the way that its handle (multiple ordered resources), cause modcluster susbsytem XSD is very permissive.
This piece of code would be an alternative if xa-data-source schema were less restrictive:
wildfly::util::resource { '/subsystem=datasources/xa-data-source=DefaultPool':
content => {
'driver-name' => 'oracle',
'jndi-name' => 'java:/jdbc/DefaultPool',
'operation' => 'add',
'password' => 'password',
'user-name' => 'undef',
}
}
->
wildfly::util::resource { '/subsystem=datasources/xa-data-source=DefaultPool/xa-datasource-properties=URL':
content => {
'value' => 'jdbc:oracle:thin:@DEFA'
}
}
from puppet-wildfly.
Alright I'll try working on this. A possible wrinkle I've found is that hashes are allowed inside resource definitions when inside arrays. Example:
wildfly::util::resource { '/subsystem=security/security-domain=MyRealm':
content => {
'cache-type' =>'default'
}
}
->
wildfly::util::resource { '/subsystem=security/security-domain=MyRealm/authentication=classic':
content => {
'login-modules' => [{
'code' => 'com.example.jaas.LoginModule',
'flag' => 'required',
'module' => 'com.example.jaas',
'module-options' => {
'dsJndiName' => 'java:/jdbc/DefaultPool'
}
}]
}
}
I think I can work around this by only considering hashes in the top level of a resource definition (including those for child resources), and ignoring hashes inside arrays.
from puppet-wildfly.
@TronPaul I'll take a look into this issue tonight and try to create a simple implementation. Inner/nested hashes seems to be a good idea for me.
A nested hash is basically a resource which name = namevar + inner hash key and content = hash value.
from puppet-wildfly.
@jairojunior I actually have something I think is close to working. It'll need some touching up before I'd consider merging it. If you're curious you can find where I'm at here.
from puppet-wildfly.
@TronPaul Awesome. I'll clone your repository.
from puppet-wildfly.
With #29 in I'll close this. Thanks for the help. Feel free to ping me on any issues that pop up with those changes.
from puppet-wildfly.
Related Issues (20)
- Error: Could not set 'file' on ensure: No such file or directory @ dir_s_mkdir HOT 2
- JBOSS-EAP with **systemctl start jboss-eap** don't works from another machine just locally HOT 1
- where the log file is stored on Puppet Agent by this module HOT 1
- on SUSE Linux /etc/init.d/jboss-eap: line 13: /etc/init.d/functions: No such file or directory HOT 1
- wildfly_restart functionality issues
- how to install und build multiple standalone instances in the same machine
- Need a way to install module with multiple jar files as source HOT 1
- Transfer this module to voxpupuli HOT 22
- wildfly::jgroups::stack::tcpping fails with "No resource definition" HOT 1
- Update test environment for Ruby 3, Puppet 7, and related Gems HOT 1
- Add parameters to domain.conf variables PROCESS_CONTROLLER_JAVA_OPTS and HOST_CONTROLLER_JAVA_OPTS
- Replace MaxPermSize with MaxMetaspaceSize in domain.conf template HOT 1
- `wildfly::host::server_config` with `ensure => absent` in already absent server tries to stop it and fails with timeout
- Include support for CLI API for actions currently performed via HTTP API HOT 2
- Multiple calls to defined type wildfly::host::server_config cause "Duplicate resource" error HOT 3
- class wildfly::setup hardcodes subsystem when setting up remote user HOT 2
- Installer download fails because install_cache_dir doesn't exist
- Module configures service only as sysvinit, regardless of actual init system, when $version < 10 HOT 1
- Update Wildfly download URL for version >= 25
- Support for Wildfly 31.0.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-wildfly.