Commit e933e6b8 authored by Charlie Root's avatar Charlie Root
Browse files

sync

parent f2be7d5c
{% from "geoserver/map.jinja" import geoserver with context %}
include:
- geoserver.plugins
{% for instance, config in geoserver.instances.items() %}
{% if config.clustering.enabled %}
{{ instance }}_geoserver_cluster_properties:
file.managed:
- name: {{ config.clustering.config.CLUSTER_CONFIG_DIR | path_join('cluster.properties') }}
- contents: |
{%- for cl_name, cl_value in config.clustering.config.items() %}
{{ cl_name }}={{ cl_value }}
{%- endfor %}
- user: {{ config.user }}
- group: {{ config.group }}
- mode: 644
- makedirs: True
- require:
- archive: {{ instance }}_geoserver_plugin_jms-cluster
{% endif %}
{% endfor %}
......@@ -14,7 +14,7 @@ include:
- require:
- archive: {{ instance }}_geoserver_archive
cmd.run:
- name: cp -R {{ config.data_dir.rstrip('/') }} {{ config.GEOSERVER_DATA_DIR }}
- name: cp -R {{ config.data_dir.rstrip('/') ~ '/' }} {{ config.GEOSERVER_DATA_DIR }}
- require:
- file: {{ instance }}_geoserver_data_dir
- unless:
......
......@@ -6,12 +6,33 @@ geoserver:
user: geoserver
group: geoserver
jdk: openjdk8
clustering:
enabled: False
config:
toggleSlave: 'true'
connection: enabled
topicName: VirtualTopic.geoserver
brokerURL:
xbeanURL: ./broker.xml
durable: 'true'
toggleMaster: 'true'
embeddedBroker: disabled
embeddedBrokerProperties: embedded-broker.properties
connection.retry: 10
readOnly: disabled
group: geoserver-cluster
connection.maxwait: 500
geoservers:
2.16.2:
jetty:
version: 9.4.18.v20190429
modules:
http:
enabled: True
jar: False
ini:
jetty.port: 8080
ext:
enabled: True
files:
......@@ -70,4 +91,3 @@ jdks:
pkg: openjdk8
JAVA_HOME: /usr/local/openjdk8
JAVA_OPTS: -server -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Xmx2048m -Xms2048m -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false
jdbc: postgresql-42.2.12.jar
include:
- geoserver.install
- geoserver.web_xml
- geoserver.plugins
- geoserver.data_dir
- geoserver.jetty.modules
- geoserver.clustering
- geoserver.service
......@@ -29,6 +29,16 @@ geoserver_home:
- file: geoserver_home
- pkg: {{ instance }}_jdk_pkg
{{ instance }}_geoserver_web_xml:
file.line:
- name: {{ config.web_xml }}
- content: |
<!-- START managed_resource_ref -->
<!-- END managed_resource_ref -->
- mode: ensure
- before: ^</web-app>
###############
# PERMISSIONS #
###############
......
......@@ -100,6 +100,8 @@ include:
- user: {{ config.user }}
- group: {{ config.group }}
- mode: 644
- require_in:
- cmd: {{ instance }}_jetty_module_{{ module }}_ini
{% else %}
......@@ -128,8 +130,28 @@ include:
- env:
- JAVA_HOME: {{ config.jdk_conf.JAVA_HOME }}
- JAVA_OPTS: {{ config.jdk_conf.JAVA_OPTS }}
# --update-ini
{% if module_config.ini is defined %}
{% for ini_name, ini_value in module_config.ini.items() %}
{{ instance }}_jetty_module_{{ module }}_ini_{{ ini_name }}:
cmd.run:
- name: {{ config.jdk_conf.JAVA_HOME | path_join('bin', 'java') }} -jar start.jar --update-ini {{ ini_name }}={{ ini_value }}
- cwd: {{ config.GEOSERVER_HOME }}
- runas: {{ config.user }}
- group: {{ config.group }}
- shell: /bin/csh
- env:
- JAVA_HOME: {{ config.jdk_conf.JAVA_HOME }}
- JAVA_OPTS: {{ config.jdk_conf.JAVA_OPTS }}
- require:
- file: {{ instance }}_jetty_module_{{ module }}_config
- cmd: {{ instance }}_jetty_module_{{ module }}_ini
{% endfor %}
{% endif %}
{% else %}
{{ instance }}_jetty_module_{{ module }}_ini:
......@@ -140,5 +162,6 @@ include:
- backup: False
{% endif %}
{% endfor %}
{% endfor %}
......@@ -43,6 +43,10 @@
'GEOSERVER_DATA_DIR': geoserver.root|path_join(
instance, 'geoserver-' ~ config.version, 'data_dir'
),
'web_xml': geoserver.root|path_join(
instance, 'geoserver-' ~ config.version, 'webapps', 'geoserver',
'WEB-INF', 'web.xml'
),
'lib': geoserver.root|path_join(
instance, 'geoserver-' ~ config.version, 'webapps', 'geoserver',
'WEB-INF', 'lib'
......@@ -63,8 +67,17 @@
),
},
config)
) %}
{% if config.clustering.config is defined %}
{% do config.clustering.config.update(
salt.slsutil.merge({
'CLUSTER_CONFIG_DIR': config.GEOSERVER_DATA_DIR|path_join('cluster'),
'instanceName': instance
},
config.clustering.config)
) %}
{% endif %}
{# Plugins #}
......
{% from "geoserver/map.jinja" import geoserver with context %}
include:
- runit
{% for instance, config in geoserver.instances.items() %}
{{ instance }}_geoserver_service:
file.managed:
- name: /var/service/geoserver_{{ instance }}/run
- user: root
- group: wheel
- mode: 755
- makedirs: True
- contents: |
#!/bin/sh
exec chpst -u geoserver \
/bin/sh -c '
export JAVA_HOME="{{ config.jdk_conf.JAVA_HOME }}"
export GEOSERVER_DATA_DIR="{{ config.GEOSERVER_DATA_DIR }}"
export GEOSERVER_LOG_LOCATION="{{ config.log }}"
export GEOSERVER_REQUIRE_FILE="{{ config.GEOSERVER_DATA_DIR | path_join('global.xml') }}"
export GWC_DISKQUOTA_DISABLED=true
export GWC_METASTORE_DISABLED=true
export JAVA_OPTS="{{ config.jdk_conf.JAVA_OPTS }}"
cd {{ config.bin_dir }}
./startup.sh
'
{% endfor %}
{% from "geoserver/map.jinja" import geoserver with context %}
include:
- geoserver.install
{% for instance, config in geoserver.instances.items() %}
{% if config.jndis is defined %}
{{ instance }}_geoserver_web_xml_JNDI:
file.blockreplace:
- name: {{ config.web_xml }}
- marker_start: <!-- START managed_resource_ref -->
- marker_end: <!-- END managed_resource_ref -->
- content: |
{%- for jndi_name, jndi_conf in config.jndis.items() %}
<resource-ref>
<description>{{ jndi_name }}</description>
<res-ref-name>jdbc/{{ jndi_name }}</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
{%- endfor %}
- require:
- file: {{ instance }}_geoserver_web_xml
{% endif %}
{% endfor %}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment