パペットもオーガスも初めてで、困っています。JBoss EAP 6.3 を (スタンドアロンモードで) インストールする puppet モジュールがありますが、ユーザーが SSL を使用して JBoss デプロイメントを設定できるようにスクリプトをアップグレードする必要があります。これにより、puppet を使用して、いくつかの XML を standalone.xml 構成ファイルに挿入することにしました。xml 要素の 1 つに、複数の属性が含まれている必要があります。コマンド ラインで augtool を使用したところ、1 つの属性を持つ要素を挿入できました。しかし、既存の要素にさらに属性を設定しようとすると、パスまたはコマンドをフォーマットする方法がわかりません。ご提供いただけるご支援をいただければ幸いです。
augtool コマンドの例:
augtool> set /augeas/load/Xml/lens Xml.lns
augtool> set /augeas/load/Xml/incl[2] /usr/share/jboss/jboss-eap-6.3/standalone/configuration/standalone.xml
augtool> load
augtool> set /files/usr/share/jboss/jboss-eap-6.3/standalone/configuration/standalone.xml/server/profile/subsystem[#attribute/xmlns="urn:jboss:domain:web:2.1"]/connector[last()+1]/#attribute[name="https"]/name "https"
augtool> save
Saved 1 file(s)
試行 1:
augtool> set /augeas/load/Xml/lens Xml.lns
augtool> set /augeas/load/Xml/incl[2] /usr/share/jboss/jboss-eap-6.3/standalone/configuration/standalone.xml
augtool> load
augtool> set /files/usr/share/jboss/jboss-eap-6.3/standalone/configuration/standalone.xml/server/profile/subsystem[#attribute/xmlns="urn:jboss:domain:web:2.1"]/connector[last()+1]/#attribute[name="https"]/name "https"
augtool> set /files/usr/share/jboss/jboss-eap-6.3/standalone/configuration/standalone.xml/server/profile/subsystem[#attribute/xmlns="urn:jboss:domain:web:2.1"]/connector[last()]/#attribute[protocol="HTTP/1.1"]/protocol "HTTP/1.1"
augtool> save
error: Failed to execute command
saving failed (run 'print /augeas//error' for details)
augtool> print /augeas//error
/augeas/files/usr/share/jboss/jboss-eap-6.3/standalone/configuration/standalone.xml/error/message = "Failed to match \n { /#attribute/ }?({ /#text/ = /(\\\\]\\\\]\\\\]*[^]\\001-\\004<>][^]\\001-\\004<]*\\\\]|(\\\\][^]\\001-\\004<]|[^]\\001-\\004<][^]\\001-\\004<])[^]\\001-\\004<]*\\\\]|[^]\\001-\\004<]\\\\])(\\\\]\\\\]*[^]\\001-\\004<>][^]\\001-\\004<]*\\\\]|[^]\\001-\\004<][^]\\001-\\004<]*\\\\])*(\\\\]\\\\]*([^]\\001-\\004<>][^]\\001-\\004<]*|)|[^]\\001-\\004<][^]\\001-\\004<]*|)|\\\\]\\\\]\\\\]*([^]\\001-\\004<>][^]\\001-\\004<]*|)|(\\\\][^]\\001-\\004<]|[^]\\001-\\004<][^]\\001-\\004<])[^]\\001-\\004<]*|\\\\]|[^]\\001-\\004<]/ } | { /#comment/ = /([^\\001-\\004-]|-[^\\001-\\004-])*/ } | <<rec>> | { /[:A-Z_a-z][.0-:A-Z_a-z-]*/ = /#empty/ } | { /#pi/ })*\n with tree\n { \"#attribute\" } { \"#attribute\" }"
最終的にやりたいことは、次のような XML を作成して挿入するのに役立つ一連のコマンドを見つけることです。
<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https">
<ssl name="https" password="mypassword" certificate-key-file="${jboss.server.config.dir}/keystore.jks"/>
</connector>