Got the project started with some basic defaults and a package install
This commit is contained in:
parent
3b716660e2
commit
e9f90fe406
12
sssd/defaults.yaml
Normal file
12
sssd/defaults.yaml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
sssd:
|
||||||
|
# package options
|
||||||
|
package_name: sssd
|
||||||
|
package_status: installed
|
||||||
|
|
||||||
|
# configuration file options
|
||||||
|
config_path: /etc/sssd/sssd.conf
|
||||||
|
|
||||||
|
# service options
|
||||||
|
service_name: sssd
|
||||||
|
service_status: running
|
||||||
|
|
6
sssd/init.sls
Normal file
6
sssd/init.sls
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{% from "sssd/map.jinja" import sssd_settings as sssd with context %}
|
||||||
|
|
||||||
|
sssd_package:
|
||||||
|
pkg.{{ sssd.package_status }}:
|
||||||
|
- name: {{ sssd.package_name }}
|
||||||
|
|
35
sssd/map.jinja
Normal file
35
sssd/map.jinja
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# vim: ft=jinja
|
||||||
|
|
||||||
|
{## Start with defaults from defaults.sls ##}
|
||||||
|
{% import_yaml 'sssd/defaults.yaml' as default_settings %}
|
||||||
|
|
||||||
|
{##
|
||||||
|
Setup variable using grains['os_family'] based logic, only add key:values here
|
||||||
|
that differ from whats in defaults.yaml
|
||||||
|
##}
|
||||||
|
{% set flavor_map = salt['grains.filter_by'](
|
||||||
|
{
|
||||||
|
'Debian': {
|
||||||
|
'package_extra': ['libpam-runtime', 'libpam-sss', 'libnss-sss'],
|
||||||
|
},
|
||||||
|
'FreeBSD': {
|
||||||
|
'package_extra': False,
|
||||||
|
},
|
||||||
|
'RedHat': {
|
||||||
|
'package_extra': ['authconfig'],
|
||||||
|
}
|
||||||
|
},
|
||||||
|
grain='os_family',
|
||||||
|
merge=salt['pillar.get']('sssd:lookup')
|
||||||
|
) %}
|
||||||
|
|
||||||
|
{## Merge the flavor_map over the default settings ##}
|
||||||
|
{% do default_settings.sssd.update(flavor_map) %}
|
||||||
|
|
||||||
|
{## Merge in changes from the sssd:lookup pillar ##}
|
||||||
|
{% set sssd_settings = salt['pillar.get'](
|
||||||
|
'sssd',
|
||||||
|
default=default_settings.sssd,
|
||||||
|
merge=True
|
||||||
|
) %}
|
Loading…
Reference in New Issue
Block a user