0
0
mirror of https://github.com/saltstack-formulas/salt-formula.git synced 2024-12-26 17:46:09 +01:00
salt-formula/salt/gitfs/keys.sls
Matthew X. Economou 3746f08f2f
Use a different group name for GID 0 depending on the minion's O/S
Some Unix variants name GID 0 "wheel".  Unfortunately, one cannot
specify this group by ID, because Python conflates integer 0 with
boolean False, nor can one specify this group using the string '0',
because of assumptions in the Salt or Python codebases regarding group
names.
2017-01-13 10:14:34 -05:00

26 lines
714 B
Plaintext

{%- from "salt/map.jinja" import salt_settings with context %}
{%- set gitfs_keys=salt['pillar.get']('salt:gitfs:keys', {}) %}
{%- for key, keyvalues in gitfs_keys.items() %}
{%- for type, keydata in keyvalues.items() %}
gitfs-key-{{ key }}-{{ type }}:
file.managed:
- name: {{ salt_settings.config_path }}/pki/gitfs/{{ key }}.{{ type }}
- source: salt://salt/files/gitfs_key.jinja
- template: jinja
- user: root
- group:
{%- if grains['kernel'] in ['FreeBSD', 'OpenBSD', 'NetBSD'] %}
wheel
{%- else %}
root
{%- endif %}
- mode: 600
- makedirs: True
- defaults:
key: {{ key }}
type: {{ type }}
{%- endfor %}
{%- endfor %}