Skip to content
Snippets Groups Projects
Unverified Commit d1bb84fd authored by Danny Smit's avatar Danny Smit Committed by Imran Iqbal
Browse files

refactor(map.jinja): use `template-formula` structure & add `debian-10`

parent 43fc17a5
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: ft=jinja # vim: ft=jinja
{% import_yaml "tomcat/defaults.yaml" as defaults %} {#- Get the `tplroot` from `tpldir` #}
{% import_yaml "tomcat/osmap.yaml" as osmap %} {%- set tplroot = tpldir.split('/')[0] %}
{% import_yaml "tomcat/codenamemap.yaml" as codemap %} {#- Start imports as #}
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %}
{%- import_yaml tplroot ~ "/osfamilymap.yaml" as osfamilymap %}
{%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %}
{# get the settings for the os_family grain #} {#- Retrieve the config dict only once #}
{% set osfam = salt['grains.filter_by'](osmap) or {} %} {%- set _config = salt['config.get'](tplroot, default={}) %}
{# 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 {} %}
{# merge the os family/codename specific data over the defaults #} {%- set defaults = salt['grains.filter_by'](
{% do defaults.tomcat.update(oscode) %} default_settings,
default=tplroot,
merge=salt['grains.filter_by'](
osfamilymap,
grain='os_family',
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 config = salt['grains.filter_by'](
{% set lookup = salt['pillar.get']('tomcat:lookup', {'defaults': defaults},
default=defaults.tomcat, default='defaults',
merge=True) %} merge=_config
)
%}
{# merge the actual tomcat pillar into the above combined dict #} {%- set tomcat = config %}
{% set tomcat = salt['pillar.get']('tomcat', default=lookup, merge=True) %}
...@@ -19,10 +19,6 @@ RedHat: ...@@ -19,10 +19,6 @@ RedHat:
native_pkg: tomcat-native native_pkg: tomcat-native
manager_pkg: tomcat-admin-webapps manager_pkg: tomcat-admin-webapps
main_config_template: salt://tomcat/files/tomcat-default-CentOS.template main_config_template: salt://tomcat/files/tomcat-default-CentOS.template
CentOS:
native_pkg: tomcat-native
manager_pkg: tomcat-admin-webapps
main_config_template: salt://tomcat/files/tomcat-default-CentOS.template
openSUSE: openSUSE:
ver: 8 ver: 8
native_pkg: libtcnative-1-0 native_pkg: libtcnative-1-0
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: ft=yaml # vim: ft=yaml
--- ---
trusty: Ubuntu-14.04:
ver: 7 ver: 7
pkg: tomcat7 pkg: tomcat7
manager_pkg: tomcat7-admin manager_pkg: tomcat7-admin
...@@ -11,7 +11,7 @@ trusty: ...@@ -11,7 +11,7 @@ trusty:
service: tomcat7 service: tomcat7
user: tomcat7 user: tomcat7
group: tomcat7 group: tomcat7
wheezy: Debian-7:
pkg: tomcat7 pkg: tomcat7
manager_pkg: tomcat7-admin manager_pkg: tomcat7-admin
conf_dir: /etc/tomcat7 conf_dir: /etc/tomcat7
...@@ -20,3 +20,12 @@ wheezy: ...@@ -20,3 +20,12 @@ wheezy:
service: tomcat7 service: tomcat7
user: tomcat7 user: tomcat7
group: tomcat7 group: tomcat7
Debian-10:
ver: 9
pkg: tomcat9
manager_pkg: tomcat9-admin
conf_dir: /etc/tomcat9
main_config: /etc/default/tomcat9
service: tomcat9
user: tomcat
group: tomcat
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment