-
-
Save anonymous/a7be6174e80d2f52a2a5 to your computer and use it in GitHub Desktop.
This file contains 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
----- /srv/pillar/pkg/init.sls --- | |
tomcat_sections: | |
{% elif (grains['id'] == 'myserver.dmz.com') %} | |
1: | |
portal: | |
name: portal | |
server: dbp | |
url: PORTAL | |
username: user | |
password: pass | |
load: | |
name: load | |
server: dbp | |
url: OG | |
username: user1 | |
password: pass1 | |
2: | |
portal: | |
name: portal | |
server: dbp | |
url: PORTAL | |
username: user | |
password: pass | |
gmt: | |
name: gmt | |
server: dbp | |
url: MG | |
username: user2 | |
password: pass2 | |
{% endif %} | |
------- server.sls ----------- | |
{% set tomcat_sections = pillar.get('tomcat_sections', {}) %} | |
{% if tomcat_sections == None %} | |
{% else %} | |
{% for instance, connections in tomcat_sections.items() %} | |
/var/lib/{{ grains['host'] }}{{ instance }}/conf/server.xml: | |
file.managed: | |
- user: root | |
- group: tomcat7 | |
- mode: 644 | |
- source: salt://tomcat7/files/conf/server.xml | |
- template: jinja | |
- defaults: | |
pool: {{ connections }} | |
{% endfor %} | |
{% endif %} | |
---------- server.xml ---------- | |
<Server port="8005" shutdown="SHUTDOWN"> | |
{%- for option, value in pool.iteritems() %} | |
<!-- {{ value['name'] }} --> | |
<Resource auth="Container" type="javax.sql.DataSource" name="jdbc/{{ value['name'] }}" | |
driverClassName="com.ibm.db2.jcc.DB2Driver" | |
url="jdbc:db2://{{ value['server'] }}.dmz.com:50000/{{ value['url'] }}" | |
maxActive="20" maxIdle="10" minIdle="5" maxWait="100000" | |
initialSize="1" testOnBorrow="true" minEvictableIdleTimeMillis="1800000" | |
timeBetweenEvictionRunsMillis="1800000" testWhileIdle="true" testOnReturn="true" | |
username="{{ value['username'] }}" password="{{ value['password'] }}" | |
validationQuery="SELECT COUNT(*) FROM SYSIBM.SYSTABLES" | |
removeAbandoned="true" removeAbandonedTimeout="600" /> | |
{%- endfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment