Created
November 19, 2020 07:47
-
-
Save raphink/39a8443ee3d116e3570d41f1dcb35262 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Augeas { | |
lens => 'Xml.lns', | |
incl => '/home/raphink/bas/puppet/hibernate.cfg.xml', | |
context => '/files/home/raphink/bas/puppet/hibernate.cfg.xml/hibernate-configuration/session-factory', | |
} | |
$settings = [ | |
"set property[#attribute/name='hibernate.connection.driver_class']/#text 'org.postgresql.Driver'", | |
"ins property after property[#attribute/name='hibernate.connection.driver_class']", | |
"set property[count(#attribute)=0]/#attribute/name 'hibernate.dialect'", | |
"set property[#attribute/name='hibernate.dialect']/#text 'org.hibernate.dialect.PostgreSQLDialect'", | |
"set property[#attribute/name='hibernate.jdbc.use_streams_for_binary']/#attribute/name 'hibernate.jdbc.use_streams_for_binary'", | |
"set property[#attribute/name='hibernate.jdbc.use_streams_for_binary']/#text 'false'", | |
"set property[#attribute/name='xwiki.virtual_mode']/#attribute/name 'xwiki.virtual_mode'", | |
"set property[#attribute/name='xwiki.virtual_mode']/#text 'schema'", | |
"rm mapping[#attribute/resource='xwiki.hbm.xml']", | |
"set mapping[#attribute/resource='xwiki.postgresql.hbm.xml']/#attribute/resource 'xwiki.postgresql.hbm.xml'", | |
] | |
augeas { 'sql': | |
changes => $settings, | |
} | |
augeas { 'ins dialect': | |
changes => [ | |
"ins property after property[#attribute/name='hibernate.connection.driver_class']", | |
"set property[count(#attribute)=0]/#attribute/name 'hibernate.dialect'", | |
], | |
onlyif => 'match property[#attribute/name="hibernate.dialect"] size == 0', | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment