Skip to content

Instantly share code, notes, and snippets.

/defaults.sls Secret

Created June 14, 2017 18:21
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 anonymous/f42f313d7a6de93d9dd6ca13e56d4455 to your computer and use it in GitHub Desktop.
Save anonymous/f42f313d7a6de93d9dd6ca13e56d4455 to your computer and use it in GitHub Desktop.
file.append example
/etc/xdg/mimeapps.list:
file.absent
default_applications:
file.append:
- name: /etc/xdg/mimeapps.list
- text: |
[Default Applications]
{% for mimetype in pillar['default_applications'] %}
{{ mimetype }}:
file.append:
- name: /etc/xdg/mimeapps.list
- text:
- {{ mimetype }}=
{% for desktop in pillar['default_applications'][mimetype] %}
{{ mimetype }}_{{ desktop }}:
file.append:
- name: /etc/xdg/mimeapps.list
- text:
- {{ desktop }};
{% endfor %}
append_newline_{{ mimetype }}:
file.append:
- name: /etc/xdg/mimeapps.list
- text:
- \n
{% endfor %}
default_applications:
inode/directory:
- pcmanfm-qt.desktop
text/html:
- google-chrome.desktop
x-scheme-handler/http:
- google-chrome.desktop
x-scheme-handler/https:
- google-chrome.desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment