Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix map.jinja and add more OSes #23

Merged
merged 2 commits into from
Feb 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
template formula
================

0.1.2 (2019-02-12)

- Update map.jinja, osfamilymap.yaml & osmap.yaml

0.1.1 (2019-02-10)

- Update map.jinja and README
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# should contain the currently released version of the formula
0.1.0
0.1.2
22 changes: 11 additions & 11 deletions template/map.jinja
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# -*- coding: utf-8 -*-
# vim: ft=jinja

{## Start imports as ##}
{## Start imports as ##}
{% import_yaml 'template/defaults.yaml' as defaults %}
{% import_yaml 'template/osfamilymap.yaml' ad osfamilymap %}
{% import_yaml 'template/osmap.yaml' ad osmap %}
{% import_yaml 'template/osfamilymap.yaml' as osfamilymap %}
{% import_yaml 'template/osmap.yaml' as osmap %}

{## merge the osfamilymap ##}
{% set osfamily = salt['grains.filter_by']('osfamilymap', grain='os_family_map') or{} %}
{## Merge the osfamilymap ##}
{% set osfamily = salt['grains.filter_by'](osfamilymap, grain='os_family') or {} %}
{% do salt['defaults.merge'](defaults['template'], osfamily) %}

{## merge the osmap ##}
{% set osmap = salt['grains.filter_by']('osmap', grain='os') or{} %}
{% do salt['defaults.merge'](defaults['template'], osmap) %}
{## Merge the osmap ##}
{% set os = salt['grains.filter_by'](osmap, grain='os') or {} %}
{% do salt['defaults.merge'](defaults['template'], os) %}

{## merge the lookup ##}
{% lookup = salt['pillar.get']('template:lookup', default={}, merge=True) %}
{## Merge the lookup ##}
{% set lookup = salt['pillar.get']('template:lookup', default={}) %}
{% do salt['defaults.merge'](defaults['template'], lookup) %}

{## merge the template pillar ##}
{## Merge the template pillar ##}
{% set template = salt['pillar.get']('template', default=defaults['template'], merge=True) %}
23 changes: 21 additions & 2 deletions template/osfamilymap.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# -*- coding: utf-8 -*-
# # vim: ft=yaml
# vim: ft=yaml
#
# Setup variables using grains['os_family'] based logic.
# You just need to add the key:values for an `os_family` that differ
# from `defaults.yaml`.
# Only add an `os_family` which is/will be supported by the formula
# (empty `os_family`s do not need to be listed, just added here as an example).
---
Debian:
pkg: template-debian
Expand All @@ -12,6 +18,19 @@ RedHat:
Suse:
pkg: template-suse

Gentoo: {}

Arch:
pkg: template-arch

service:
name: service-arch

javierbertoli marked this conversation as resolved.
Show resolved Hide resolved
Alpine: {}

FreeBSD: {}

OpenBSD: {}

Windows: {}

MacOS: {}
17 changes: 15 additions & 2 deletions template/osmap.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
# -*- 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` + `os_family.yaml`.
# Only add an `os` which is/will be supported by the formula
# (empty `os`es do not need to be listed, just added here as an example).
---
javierbertoli marked this conversation as resolved.
Show resolved Hide resolved
Ubuntu:
pkg: template-ubuntu
config: /etc/template.d/custom-ubuntu.conf

Fedora:
pkg: template-fedora
javierbertoli marked this conversation as resolved.
Show resolved Hide resolved
service:
name: service-fedora

Ubuntu:
pkg: template-ubuntu
Raspbian: {}

SmartOS: {}