Special characters with JBoss CLI

こ雲淡風輕ζ 提交于 2020-02-23 04:35:04

问题


I am in domain mode with JBoss 6.4.8 version. I want to add these 4 system properties by CLI :

1- /host=myserver/server-config=node/system-property=javax.net.ssl.keyStorePassword:add(boot-time=false,value=${VAULT::vault_block::attribute_name::1})

2- /host=myserver/server-config=node/system-property=javax.net.ssl.trustStorePassword:add(boot-time=false,value=${VAULT::vault_block::attribute_name::1})

It doesn't work

 "outcome" => "failed",
    "result" => undefined,
    "failure-description" => "JBAS010839: Operation failed or was rolled back on all servers.",
    "rolled-back" => true

As you can see there is $, : and {} characters, is it my problem ?

In the past, i encountered this problem with the $ and i solve it by \$ but here it doesn't work !

Can you help me ?

Thanks a lot

Ludo


回答1:


Not sure about 6.4, but in 7 as per https://access.redhat.com/documentation/en/red-hat-jboss-enterprise-application-platform/7.0/single/management-cli-guide/#cli_special_characters you can enclose a value with "" or {}, so in your case you should put it inside ""




回答2:


Notice, vault references are not resolved if vault configuration was recently added, a restart or reload of the configuration is required before you set a vault reference.

When not resolving parameter values

When JBoss-cli is NOT configured to resolve parameter values (resolve-parameter-values set to false in jboss-cli.xml -by default-):

a) Escape with \$ when using the --command cli parameter (aka non-interactive mode)

/path/to/jboss-cli.sh -c --command="/host=myserver/server-config=node/system-property=javax.net.ssl.keyStorePassword:add(boot-time=false,value=\${VAULT::vault_block::attribute_name::1})"

b) Use direct reference when using interactive mode

/host=myserver/server-config=node/system-property=javax.net.ssl.keyStorePassword:add(boot-time=false,value=${VAULT::vault_block::attribute_name::1})

When resolving parameter values

When JBoss-cli is configured to resolve parameter values (resolve-parameter-values set to true in jboss-cli.xml):

c) Escape with \$\$ when using the --command cli parameter (this prevents parameter expansion in bash )

/path/to/jboss-cli.sh -c --command="/host=myserver/server-config=node/system-property=javax.net.ssl.keyStorePassword:add(boot-time=false,value=\$\${VAULT::vault_block::attribute_name::1})"

d) Escape with $$ when using the --file cli parameter

/path/to/jboss-cli.sh -c --file="/path/to/commands.cli"

commands.cli contents:

/host=myserver/server-config=node/system-property=javax.net.ssl.keyStorePassword:add(boot-time=false,value=$${VAULT::vault_block::attribute_name::1})"

or interactive mode

/host=myserver/server-config=node/system-property=javax.net.ssl.keyStorePassword:add(boot-time=false,value=$${VAULT::vault_block::attribute_name::1})


来源:https://stackoverflow.com/questions/40612127/special-characters-with-jboss-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!