0

Is it possible to convert the standalone.xml (or other configured Wildfly/JBoss profile XML file) to a series of commands or script that can be run by jboss-cli.sh? I have a Wildfly 11 instance that I've made config changes to. I'd like to be able to "templatize" it and have the configuration duplicated using shell scripts during my server deployment. Is there a way to export that config as jboss-cli.sh commands?

Shadowman
  • 11,150
  • 19
  • 100
  • 198
  • 1
    I'm not aware of a way to reverse engineer `standalone.xml` as it has much more than just your changes - how would the reverse engineering tool know what was "base" configuration and what was yours? The cli scripts are not too hard to write and if you get stuck run `jboss-cli` with the `--gui` option to see what it takes to set a value. – stdunbar Nov 16 '17 at 21:29
  • I have a poc over this: diffing 2 standalone instances and exporting the configuration changes as jboss-cli script – ehsavoie Nov 17 '17 at 09:49

1 Answers1

2

I haven't tried it on wildfly 11, but previously on wildfly 9 and 10 i've used https://github.com/tfonteyn/profilecloner to generate jboss-cli scripts for profile creation from scratch. The result still required manual intervention, because cli script sometimes broke order of added elements.

Also, due to bugs in Wildfly 10, adding some subsystems from scratch in jboss-cli was not possible - root element refused to be added without subelement, and vise versa (unfortunately i've lost a ticket number where issue was tracked).

Since in my environment we are using domain mode, we started to copy pre-configured profile with /profile=template-name:clone(to-profile=new-profile), but that's irrelevant in standalone case.

Andrew
  • 3,912
  • 17
  • 28