Skip to content

Commit

Permalink
Merge pull request #23 from myii/PR_map-and-yaml
Browse files Browse the repository at this point in the history
Fix `map.jinja` and add more OSes
  • Loading branch information
aboe76 authored Feb 12, 2019
2 parents 92f0b8c + b5c4987 commit a143add
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 16 deletions.
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

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).
---
Ubuntu:
pkg: template-ubuntu
config: /etc/template.d/custom-ubuntu.conf

Fedora:
pkg: template-fedora
service:
name: service-fedora

Ubuntu:
pkg: template-ubuntu
Raspbian: {}

SmartOS: {}

0 comments on commit a143add

Please sign in to comment.