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 @@
{%- 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 %}
{#- Retrieve the config dict only once #}
......@@ -14,9 +16,15 @@
{%- 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',
......@@ -27,6 +35,8 @@
)
)
)
)
)
%}
{%- 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:
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
openSUSE:
ver: 8
native_pkg: libtcnative-1-0
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
FreeBSD:
native_pkg: tomcat-native
ini_config: /etc/rc.conf
java_home: /usr
Gentoo: {}
Arch:
pkg: tomcat8
ver: 8
......@@ -51,6 +47,19 @@ Arch:
# 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') %}
......
# -*- coding: utf-8 -*-
# vim: ft=yaml
---
Ubuntu-14.04:
ver: 7
# os: Debian
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
manager_pkg: tomcat7-admin
conf_dir: /etc/tomcat7
......@@ -11,7 +22,12 @@ Ubuntu-14.04:
service: tomcat7
user: tomcat7
group: tomcat7
Debian-7:
# os: Ubuntu
Ubuntu-18.04: {}
Ubuntu-16.04: {}
Ubuntu-14.04:
ver: 7
pkg: tomcat7
manager_pkg: tomcat7-admin
conf_dir: /etc/tomcat7
......@@ -20,12 +36,28 @@ Debian-7:
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
# os: Fedora
Fedora-31: {}
Fedora-30: {}
# os: CentOS
CentOS Linux-8: {}
CentOS Linux-7: {}
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