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
Branches
No related tags found
No related merge requests found
# -*- 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 ~ "/osfamilymap.yaml" as osfamilymap %}
{%- 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'](
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 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 %}
......@@ -19,10 +19,6 @@ RedHat:
native_pkg: tomcat-native
manager_pkg: tomcat-admin-webapps
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:
ver: 8
native_pkg: libtcnative-1-0
......
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
trusty:
Ubuntu-14.04:
ver: 7
pkg: tomcat7
manager_pkg: tomcat7-admin
......@@ -11,7 +11,7 @@ trusty:
service: tomcat7
user: tomcat7
group: tomcat7
wheezy:
Debian-7:
pkg: tomcat7
manager_pkg: tomcat7-admin
conf_dir: /etc/tomcat7
......@@ -20,3 +20,12 @@ wheezy:
service: tomcat7
user: 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