diff --git a/template/config/file.sls b/template/config/file.sls index 25775280..fa609d3c 100644 --- a/template/config/file.sls +++ b/template/config/file.sls @@ -20,6 +20,7 @@ template-config-file-file-managed: - mode: 644 - user: root - group: {{ template.rootgroup }} + - makedirs: True - template: jinja - require: - sls: {{ sls_package_install }} diff --git a/template/osfamilymap.yaml b/template/osfamilymap.yaml index 92cbb4a7..1d897fef 100644 --- a/template/osfamilymap.yaml +++ b/template/osfamilymap.yaml @@ -10,6 +10,10 @@ # you will need to provide at least an empty dict in this file, e.g. # osfamilymap: {} --- +{%- if grains.os == 'MacOS' %} + {% set rootgroup = salt['cmd.run']("stat -f '%Sg' /dev/console") %} +{%- endif %} + Debian: pkg: template-debian config: /etc/template.d/custom.conf @@ -40,4 +44,5 @@ Solaris: {} Windows: {} -MacOS: {} +MacOS: + rootgroup: {{ rootgroup | d('') }}