Skip to content

Commit

Permalink
Merge pull request #10 from keesbos/fixes
Browse files Browse the repository at this point in the history
Fixes typos map.jinja
  • Loading branch information
nmadhok committed Oct 28, 2015
2 parents f009eca + 151457b commit b2c03c1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
6 changes: 3 additions & 3 deletions sysstat/config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ sysstat-config:
- template: jinja
- defaults:
enabled: "{{ config_settings.enabled }}"
sa1_options: {{ config_settings.sa1_opts }}
sa2_options: {{ config_settings.sa2_opts }}
{% if systat_settings.service.enabled %}
sa1_options: {{ config_settings.sa1_options }}
sa2_options: {{ config_settings.sa2_options }}
{% if sysstat_settings.service.enabled %}
- listen_in:
- service: sysstat-service
{% endif %}
17 changes: 5 additions & 12 deletions sysstat/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,15 @@
{% import_yaml 'sysstat/defaults.yml' as default_settings %}

{## setup variable using grains['os_family'] based logic ##}
{% set os_family_map = salt['grains.filter_by']({
{% set sysstat_settings = salt['grains.filter_by']({
'Debian': default_settings.sysstat,
'RedHat': {
"service": {
"name": "sysstat",
"enabled": False
}
}
}, grain="os_family")
%}
{## Merge the flavor_map to the default settings ##}
{% do default_settings.sysstat.update(os_family_map) %}

{## Merge in sysstat:lookup pillar ##}
{% set sysstat_settings = salt['pillar.get'](
'sysstat:lookup',
default=default_settings.sysstat,
merge=True
)
}, grain="os_family", default='Debian',
merge=salt['pillar.get']('sysstat:lookup')
)
%}
4 changes: 2 additions & 2 deletions sysstat/package.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{## import settings from map.jinja ##}
{% from "sysstat/map.jinja" import sysstat_settings with context %}
systat-pkg:
sysstat-pkg:
pkg.installed:
- name: {{ systat_settings.pkg }}
- name: {{ sysstat_settings.pkg }}
- failhard: True
6 changes: 3 additions & 3 deletions sysstat/service.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
{## import settings from map.jinja ##}
{% from "sysstat/map.jinja" import sysstat_settings with context %}
{% if systat_settings.service.enabled %}
systat-service:
{% if sysstat_settings.service.enabled %}
sysstat-service:
service.running:
- name: {{ systat_settings.service.name }}
- name: {{ sysstat_settings.service.name }}
- enable: True
{% endif %}

0 comments on commit b2c03c1

Please sign in to comment.