Skip to content

Instantly share code, notes, and snippets.

#/srv/salt/random/init.sls
/tmp/random/randomstuff:
file.prepend:
- text:
- "{{salt['pillar.get']('headers:salt:file')}}"
#/srv/pillar/headers/init.sls
headers:
salt:
file: |
#checking dir and appending text to the bottom of file
#/srv/salt/random/init.sls
{% if not salt['file.directory_exists' ]('/home/init_dir') %}
/tmp/random:
file.directory:
- user: root
- name: /tmp/random
- group: root
- mode: 755
{% else %}