From 378229a35964bc6e18b0ecd9b867aac4bd0ac7d4 Mon Sep 17 00:00:00 2001 From: Greg Ballantine Date: Mon, 30 Oct 2017 13:23:16 -0400 Subject: [PATCH] Added package installed for FreeBSD --- nsswitch/defaults.yaml | 2 ++ nsswitch/init.sls | 8 ++++++++ nsswitch/map.jinja | 3 ++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/nsswitch/defaults.yaml b/nsswitch/defaults.yaml index 4609a6d..31f4b34 100644 --- a/nsswitch/defaults.yaml +++ b/nsswitch/defaults.yaml @@ -1,4 +1,6 @@ nsswitch: + package_name: False config_path: /etc/nsswitch.conf config_mode: '0644' + diff --git a/nsswitch/init.sls b/nsswitch/init.sls index e6da1d6..58ff6bd 100644 --- a/nsswitch/init.sls +++ b/nsswitch/init.sls @@ -1,5 +1,13 @@ {% from "nsswitch/map.jinja" import nsswitch_settings as nsswitch with context %} +{% if nsswitch.package_name %} +nsswitch_package: + pkg.installed: + - name: {{ nsswitch.package_name }} + - require_in: + - file: nsswitch_config +{% endif %} + nsswitch_config: file.managed: - name: {{ nsswitch.config_path }} diff --git a/nsswitch/map.jinja b/nsswitch/map.jinja index 5fff502..a2f06f9 100644 --- a/nsswitch/map.jinja +++ b/nsswitch/map.jinja @@ -14,7 +14,8 @@ that differ from whats in defaults.yaml 'config_path': '/etc/nsswitch.conf', }, 'FreeBSD': { - 'config_path': '/etc/nsswitch.conf', + 'package_name': 'nss' + 'config_path': '/usr/local/etc/nsswitch.conf', }, 'RedHat': { 'config_path': '/etc/nsswitch.conf',