-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from danny-smit/debian10
Rework map.jinja according to the template-formula and add support for Debian 10
- Loading branch information
Showing
11 changed files
with
308 additions
and
137 deletions.
There are no files selected for viewing
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,49 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=jinja | ||
|
||
{% import_yaml "tomcat/defaults.yaml" as defaults %} | ||
{% import_yaml "tomcat/osmap.yaml" as osmap %} | ||
{% import_yaml "tomcat/codenamemap.yaml" as codemap %} | ||
{#- Get the `tplroot` from `tpldir` #} | ||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{#- Start imports as #} | ||
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %} | ||
{%- import_yaml tplroot ~ "/osarchmap.yaml" as osarchmap %} | ||
{%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %} | ||
{%- import_yaml tplroot ~ "/osmap.yaml" as osmap %} | ||
{%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %} | ||
|
||
{# get the settings for the os_family grain #} | ||
{% set osfam = salt['grains.filter_by'](osmap) or {} %} | ||
{# get the settings for the oscodename grain, os_family data will override | ||
oscodename data #} | ||
{% set oscode = salt['grains.filter_by'](codemap, | ||
grain='oscodename', | ||
merge=osfam) or {} %} | ||
{#- Retrieve the config dict only once #} | ||
{%- set _config = salt['config.get'](tplroot, default={}) %} | ||
|
||
{# merge the os family/codename specific data over the defaults #} | ||
{% do defaults.tomcat.update(oscode) %} | ||
{%- set defaults = salt['grains.filter_by']( | ||
default_settings, | ||
default=tplroot, | ||
merge=salt['grains.filter_by']( | ||
osarchmap, | ||
grain='osarch', | ||
merge=salt['grains.filter_by']( | ||
osfamilymap, | ||
grain='os_family', | ||
merge=salt['grains.filter_by']( | ||
osmap, | ||
grain='os', | ||
merge=salt['grains.filter_by']( | ||
osfingermap, | ||
grain='osfinger', | ||
merge=salt['grains.filter_by']( | ||
_config, | ||
default='lookup' | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
%} | ||
|
||
{# merge the pillar:lookup dict into the defaults/os specific dict #} | ||
{% set lookup = salt['pillar.get']('tomcat:lookup', | ||
default=defaults.tomcat, | ||
merge=True) %} | ||
{%- set config = salt['grains.filter_by']( | ||
{'defaults': defaults}, | ||
default='defaults', | ||
merge=_config | ||
) | ||
%} | ||
|
||
{# merge the actual tomcat pillar into the above combined dict #} | ||
{% set tomcat = salt['pillar.get']('tomcat', default=lookup, merge=True) %} | ||
{%- set tomcat = config %} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=yaml | ||
# | ||
# Setup variables using grains['osarch'] based logic. | ||
# You just need to add the key:values for an `osarch` that differ | ||
# from `defaults.yaml`. | ||
# Only add an `osarch` which is/will be supported by the formula. | ||
# | ||
# If you do not need to provide defaults via the `osarch` grain, | ||
# you will need to provide at least an empty dict in this file, e.g. | ||
# osarch: {} | ||
--- | ||
amd64: | ||
arch: amd64 | ||
|
||
x86_64: | ||
arch: amd64 | ||
|
||
386: | ||
arch: 386 | ||
|
||
arm64: | ||
arch: arm64 | ||
|
||
armv6l: | ||
arch: armv6l | ||
|
||
armv7l: | ||
arch: armv7l | ||
|
||
ppc64le: | ||
arch: ppc64le | ||
|
||
s390x: | ||
arch: s390x |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=yaml | ||
--- | ||
Debian: | ||
ver: 8 | ||
pkg: tomcat8 | ||
native_pkg: libtcnative-1 | ||
manager_pkg: tomcat8-admin | ||
with_haveged: true | ||
haveged_enabled: true | ||
conf_dir: /etc/tomcat8 | ||
main_config: /etc/default/tomcat8 | ||
main_config_template: salt://tomcat/files/tomcat-default-Debian.template | ||
service: tomcat8 | ||
user: tomcat8 | ||
group: tomcat8 | ||
java_home: /usr/lib/jvm/default-java | ||
|
||
RedHat: | ||
native_pkg: tomcat-native | ||
manager_pkg: tomcat-admin-webapps | ||
main_config_template: salt://tomcat/files/tomcat-default-CentOS.template | ||
|
||
Suse: | ||
ver: 8 | ||
native_pkg: libtcnative-1-0 | ||
manager_pkg: tomcat-admin-webapps | ||
main_config_template: salt://tomcat/files/tomcat-default-CentOS.template | ||
|
||
Gentoo: {} | ||
|
||
Arch: | ||
pkg: tomcat8 | ||
ver: 8 | ||
service: tomcat8 | ||
native_pkg: tomcat-native | ||
conf_dir: /etc/tomcat8 | ||
main_config: /usr/lib/systemd/system/tomcat8.service | ||
main_config_template: salt://tomcat/files/tomcat-default-Arch.template | ||
user: tomcat8 | ||
group: tomcat8 | ||
java_home: /usr/lib/jvm/default-runtime | ||
jvm_tmp: /var/tmp/tomcat8/temp | ||
catalina_pid: /var/run/tomcat8.pid | ||
catalina_base: /usr/share/tomcat8 | ||
catalina_home: /usr/share/tomcat8 | ||
# Not used on Arch | ||
manager_pkg: '' | ||
|
||
Alpine: {} | ||
|
||
FreeBSD: | ||
native_pkg: tomcat-native | ||
ini_config: /etc/rc.conf | ||
java_home: /usr | ||
|
||
OpenBSD: {} | ||
|
||
Solaris: {} | ||
|
||
Windows: {} | ||
|
||
{%- if grains.os == 'MacOS' %} | ||
{%- if salt['cmd.run']('/usr/libexec/java_home -F', output_loglevel="quiet") == 0 %} | ||
{%- set darwin_javahome = salt['cmd.run']('/usr/libexec/java_home') %} | ||
{%- else %} | ||
{%- set darwin_javahome = "" %} | ||
{%- endif %} | ||
MacOS: | ||
# yamllint disable rule:line-length | ||
user: {{ salt['pillar.get']('tomcat:user', salt['cmd.run']("stat -f '%Su' /dev/console")) }} | ||
group: {{ salt['pillar.get']('tomcat:group', salt['cmd.run']("stat -f '%Sg' /dev/console")) }} | ||
# yamllint enable rule:line-length | ||
|
||
java_home: {{ darwin_javahome }} | ||
service: homebrew.mxcl.tomcat | ||
ver: 8 | ||
pkg: tomcat | ||
native_pkg: tomcat-native | ||
conf_dir: /usr/local/opt/tomcat/libexec/conf | ||
main_config: /usr/local/opt/tomcat/libexec/bin/setenv.sh | ||
main_config_template: salt://tomcat/files/tomcat-default-CentOS.template | ||
limits_prefix: /Library/LaunchAgents/maxfiles.plist | ||
jvm_tmp: /usr/local/opt/tomcat/libexec/temp | ||
catalina_base: /usr/local/opt/tomcat/libexec | ||
catalina_home: /usr/local/opt/tomcat/libexec | ||
catalina_tmpdir: /usr/local/opt/tomcat/libexec/temp | ||
|
||
# Not used on Darwin | ||
manager_pkg: '' | ||
with_haveged: false | ||
haveged_enabled: false | ||
|
||
# Not verified on Darwin | ||
cluster: | ||
simple: false | ||
|
||
{%- endif %} |
Oops, something went wrong.