Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@asjalik
Created January 21, 2016 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asjalik/157f17ecee2aa3c70ae7 to your computer and use it in GitHub Desktop.
Save asjalik/157f17ecee2aa3c70ae7 to your computer and use it in GitHub Desktop.
#/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: |
# THIS FILE IS MANAGED BY SALTSTACK #
#output:
root@salt-master:/srv/salt/random# salt 'salt-www1.arendus.kit' state.sls random
salt-www1.arendus.kit:
----------
ID: /tmp/random
Function: file.directory
Result: True
Comment: Directory /tmp/random is in the correct state
Started: 10:37:24.473975
Duration: 1.109 ms
Changes:
----------
ID: /tmp/random/randomstuff
Function: file.prepend
Result: True
Comment: Prepended 1 lines
Started: 10:37:24.475218
Duration: 3.391 ms
Changes:
----------
diff:
---
+++
@@ -1,3 +1,4 @@
+# THIS FILE IS MANAGED BY SALTSTACK #
#
#
kana
Summary for salt-www1.arendus.kit
------------
Succeeded: 2 (changed=1)
Failed: 0
------------
Total states run: 2
Total run time: 4.500 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment