Skip to content
Snippets Groups Projects
Unverified Commit db49764e authored by Imran Iqbal's avatar Imran Iqbal
Browse files

refactor: standardise structure from the `template-formula`

parent d1bb84fd
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
{%- set tplroot = tpldir.split('/')[0] %} {%- set tplroot = tpldir.split('/')[0] %}
{#- Start imports as #} {#- Start imports as #}
{%- import_yaml tplroot ~ "/defaults.yaml" as default_settings %} {%- 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 ~ "/osfamilymap.yaml" as osfamilymap %}
{%- import_yaml tplroot ~ "/osmap.yaml" as osmap %}
{%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %} {%- import_yaml tplroot ~ "/osfingermap.yaml" as osfingermap %}
{#- Retrieve the config dict only once #} {#- Retrieve the config dict only once #}
...@@ -14,9 +16,15 @@ ...@@ -14,9 +16,15 @@
{%- set defaults = salt['grains.filter_by']( {%- set defaults = salt['grains.filter_by'](
default_settings, default_settings,
default=tplroot, default=tplroot,
merge=salt['grains.filter_by'](
osarchmap,
grain='osarch',
merge=salt['grains.filter_by']( merge=salt['grains.filter_by'](
osfamilymap, osfamilymap,
grain='os_family', grain='os_family',
merge=salt['grains.filter_by'](
osmap,
grain='os',
merge=salt['grains.filter_by']( merge=salt['grains.filter_by'](
osfingermap, osfingermap,
grain='osfinger', grain='osfinger',
...@@ -27,6 +35,8 @@ ...@@ -27,6 +35,8 @@
) )
) )
) )
)
)
%} %}
{%- set config = salt['grains.filter_by']( {%- set config = salt['grains.filter_by'](
......
# -*- 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
...@@ -15,24 +15,20 @@ Debian: ...@@ -15,24 +15,20 @@ Debian:
user: tomcat8 user: tomcat8
group: tomcat8 group: tomcat8
java_home: /usr/lib/jvm/default-java java_home: /usr/lib/jvm/default-java
RedHat: 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
openSUSE:
ver: 8
native_pkg: libtcnative-1-0
manager_pkg: tomcat-admin-webapps
main_config_template: salt://tomcat/files/tomcat-default-CentOS.template
Suse: Suse:
ver: 8 ver: 8
native_pkg: libtcnative-1-0 native_pkg: libtcnative-1-0
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
FreeBSD:
native_pkg: tomcat-native Gentoo: {}
ini_config: /etc/rc.conf
java_home: /usr
Arch: Arch:
pkg: tomcat8 pkg: tomcat8
ver: 8 ver: 8
...@@ -51,6 +47,19 @@ Arch: ...@@ -51,6 +47,19 @@ Arch:
# Not used on Arch # Not used on Arch
manager_pkg: '' manager_pkg: ''
Alpine: {}
FreeBSD:
native_pkg: tomcat-native
ini_config: /etc/rc.conf
java_home: /usr
OpenBSD: {}
Solaris: {}
Windows: {}
{%- if grains.os == 'MacOS' %} {%- if grains.os == 'MacOS' %}
{%- if salt['cmd.run']('/usr/libexec/java_home -F', output_loglevel="quiet") == 0 %} {%- if salt['cmd.run']('/usr/libexec/java_home -F', output_loglevel="quiet") == 0 %}
{%- set darwin_javahome = salt['cmd.run']('/usr/libexec/java_home') %} {%- set darwin_javahome = salt['cmd.run']('/usr/libexec/java_home') %}
......
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# vim: ft=yaml # vim: ft=yaml
--- ---
Ubuntu-14.04: # os: Debian
ver: 7 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
Debian-9: {}
Debian-8: {}
Debian-7:
pkg: tomcat7 pkg: tomcat7
manager_pkg: tomcat7-admin manager_pkg: tomcat7-admin
conf_dir: /etc/tomcat7 conf_dir: /etc/tomcat7
...@@ -11,7 +22,12 @@ Ubuntu-14.04: ...@@ -11,7 +22,12 @@ Ubuntu-14.04:
service: tomcat7 service: tomcat7
user: tomcat7 user: tomcat7
group: tomcat7 group: tomcat7
Debian-7:
# os: Ubuntu
Ubuntu-18.04: {}
Ubuntu-16.04: {}
Ubuntu-14.04:
ver: 7
pkg: tomcat7 pkg: tomcat7
manager_pkg: tomcat7-admin manager_pkg: tomcat7-admin
conf_dir: /etc/tomcat7 conf_dir: /etc/tomcat7
...@@ -20,12 +36,28 @@ Debian-7: ...@@ -20,12 +36,28 @@ Debian-7:
service: tomcat7 service: tomcat7
user: tomcat7 user: tomcat7
group: tomcat7 group: tomcat7
Debian-10:
ver: 9 # os: Fedora
pkg: tomcat9 Fedora-31: {}
manager_pkg: tomcat9-admin Fedora-30: {}
conf_dir: /etc/tomcat9
main_config: /etc/default/tomcat9 # os: CentOS
service: tomcat9 CentOS Linux-8: {}
user: tomcat CentOS Linux-7: {}
group: tomcat CentOS-6: {}
# os: Amazon
Amazon Linux-2: {}
Amazon Linux AMI-2018: {}
# os: SUSE
Leap-15: {}
# os: FreeBSD
FreeBSD-12: {}
# os: Windows
Windows-8.1: {}
# os: Gentoo
Gentoo-2: {}
# -*- coding: utf-8 -*-
# vim: ft=yaml
#
# Setup variables using grains['os'] based logic.
# You just need to add the key:values for an `os` that differ
# from `defaults.yaml` + `osarch.yaml` + `os_family.yaml`.
# Only add an `os` which is/will be supported by the formula.
#
# If you do not need to provide defaults via the `os` grain,
# you will need to provide at least an empty dict in this file, e.g.
# osmap: {}
---
# os_family: Debian
Ubuntu: {}
Raspbian: {}
# os_family: RedHat
Fedora: {}
CentOS: {}
Amazon: {}
# os_family: Suse
SUSE: {}
openSUSE: {}
# os_family: Gentoo
Funtoo: {}
# os_family: Arch
Manjaro: {}
# os_family: Solaris
SmartOS: {}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment