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',