现在,我们对通配符和configuration.xml的配置是由十几个相互调用的cmd脚本完成的。很直截了当,真烦人。
现在,我想通过编写一个cli脚本来摆脱所有这些,它将根据需要完成所有的配置,但一开始我已经被困住了。
我只想在CLI上添加这个xml布局:
<security-realm name="ssl-realm">
<server-identities>
<ssl>
<keystore path="server.keystore" relative-to="jboss.server.config.dir" keystore-password="password" alias="server" key-password="password"/>
</ssl>
</server-identities>
</security-realm>因此,输入/core-service=management/security-realm=ssl-realm/:add将添加安全领域。当我现在想用这样的命令添加内部部分时:
/core-service=management/security-realm=ssl-realm/:write-attribute(name=server-identity,value=ssl)
/core-service=management/security-realm=ssl-realm/server-identity=ssl/:add我明白
{
"outcome" => "failed",
"failure-description" => "WFLYCTL0201: Unknown attribute 'server-identity'",
"rolled-back" => true
}和
null当试图将服务器标识直接添加到安全领域时,如下所示:
/core-service=management/security-realm=ssl-realm/server-identity=ssl/:add我知道错误:
{
"outcome" => "failed",
"failure-description" => "WFLYCTL0175: Resource [
(\"core-service\" => \"management\"),
(\"security-realm\" => \"ssl-realm\")
] does not exist; a resource at address [
(\"core-service\" => \"management\"),
(\"security-realm\" => \"ssl-realm\"),
(\"server-identity\" => \"ssl\")
] cannot be created until all ancestor resources have been added",
"rolled-back" => true
}问谷歌或者野蝇医生并没有多大帮助。所以如果有人知道怎么做,我会很感激的。
发布于 2017-02-03 12:04:36
尝试使用以下命令:
/core-service=management/security-realm=ssl-realm:add()
/core-service=management/security-realm=ssl-realm/server-identity=ssl:add(alias=value,keystore-relative-to=jboss.standalone.config.dir,keystore-password=abc,keystore-path=abc.jks)发布于 2017-10-29 14:31:23
同样的错误也适用于数据库配置:
/subsystem=security/security-domain=testDB:add
/subsystem=security/security-domain=testDB/authentication=classic:add
/subsystem=security/security-domain=testDB/authentication=classic/login-module=Database:add(code=Database,flag=required,module-options=[("dsJndiName"=>"java:/MyDatabaseDS"),("principalsQuery"=>"select passwd from Users where username=?"),("rolesQuery"=>"select role, 'Roles' from UserRoles where username=?")])
reloadhttps://stackoverflow.com/questions/42019230
复制相似问题