Reputation: 827
By changing the management and public interface to the host name in standalone.xml , we can allow remote access to wildfly. Want to do this directly without touching the standalone xml file.
Using wildfly cli interactive mode, added the following and it works well.
/interface=localHostName/:add(inet-address= "${jboss.bind.address.management:<hostname of target box>}")
Now, i want to add the same in cli non-interactive mode using the --command/--commands option
Tried this, but getting stuck at the syntax thing,
./jboss-cli.sh --connect command="/interface=localHostName/:add(inet-address="${jboss.bind.address.management:<hostname of target box>}")"
Please let me know the correct syntax of adding an inet-address to wildfly through command option.
Upvotes: 0
Views: 3661
Reputation: 1846
actually this should work:
./jboss-cli.sh -c --command="/interface=localHostName:add(inet-address=${jboss.bind.address.management:<hostname of target box>})"
but I also get an error with the variable replacement. I checked it with this command and it worked:
./jboss-cli.sh -c --command="/interface=localHostName:add(inet-address=<hostname of target box>)"
I also had a glance at the jboss-cli.xml configuration file but the resolve-parameter-values property was already set to false so I don't know why the CLI is trying to replace this property.
The question is if you really need this property. I think you won't since you are setting it to the same property as the management-interface. So passing this property at startup will change both interfaces' inet-address values. I'm also setting the address using a CLI script and also omit the property since this interface's inet-address binding won't be changed for productional setup.
Upvotes: 2