voxpupuli / puppet-wildfly

Puppet module to install, configure and manage Wildfly (8/9/10+), JBoss EAP (6.1+/7.0+) and some Wildfly based products like apiman, Keycloak and Infinispan.
Apache License 2.0
29 stars 79 forks source link

Update resources that depend on others fails #54

Closed jairojunior closed 8 years ago

jairojunior commented 9 years ago

If you have a resource (e.g. a deployment) that depends on another resource (e.g. a datasource) and you try to update the datasource, it will fail cause wildfly_resource is not actually updating the resource, property by property, it's removing and inserting again.

Resource update should assemble a update-properties operation in order to avoid this issue.

jairojunior commented 8 years ago

Important information extracted from a comment in PR #79.

[1] In practice I've seen two ways to realize this: (1) change configuration XML (i.e. offline changes) or (2) disable deployment, change resources and enable it again. Both alternatives imply in a small downtime, and it might be related to JBoss AS 7+ architecture (subsystems are lazily loaded).

biemond commented 8 years ago

Ok,

I think some things are not possible or can make the code/procedure pretty complex. So it keep it simple and off course it should be supported by the jboss core ( we don't want to do their work).

but if you want to do manually what are the steps you should do and do you also have some downtime of the resource.

Just brainstorming ( maybe I think to simple ), maybe the administrator should say on the datasource that a particular resource is dependent, check if there is a change on the datasource, we will try to disable the resource, do the datasource change and enable it again.

jairojunior commented 8 years ago

Most of the time this has been handled by building the new resource beside the old resource with a different name. It's dirty, but it's a good way to keep track of your changes.

Another effective strategy is to rollback standalone.xml to it's initial state and reapply all resources. It could be possible to make Puppet work in conjunction with configuration history[1] to accomplish this seamlessly. (i.e. pass some sort of flag to build your new configuration on top of initial configuration)

Another update: Offline changes is not a constraint anymore since we have Offline CLI [2] in EAP 7+ / Wildfly 9+.

[1] https://docs.jboss.org/author/display/AS71/Configuration+file+history?_sscc=t [2] https://developer.jboss.org/wiki/OfflineCLIWork

jairojunior commented 8 years ago

operation-headers with ordering looks promising. Will create a separate issue for OfflineCLI and --server-config parameter.