Skip to content

Instantly share code, notes, and snippets.

@silenius
Created January 11, 2017 14:36
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 silenius/a9b97f0efde46e2f882a5621ecf6078e to your computer and use it in GitHub Desktop.
Save silenius/a9b97f0efde46e2f882a5621ecf6078e to your computer and use it in GitHub Desktop.
/usr/local/etc/salt/states/bacula/files/ cat bacula-sd.conf.jinja
# vim: syntax=config
{% for k, v in storage.devices.items() %}
Device {
Name = "{{ k }}"
{% for pk, pv in v.items() %}
{%- if pv is string -%}
{{ pk }} = "{{ pv }}"
{% elif pv == True -%}
{{ pk }} = yes
{% elif pv == False -%}
{{ pk }} = no
{% else -%}
{{ pk }} = {{ pv }}
{%- endif %}
{%- endfor %}
}
{% endfor %}
/usr/local/etc/salt/pillar/bacula/storage/ cat backup.sls
include:
- bacula
bacula:
storage:
devices:
disk:
Media Type: "file"
Archive Device: "/tank/bacula"
Label Media: yes
Removable Media: no
Random Access: yes
Automatic Mount: yes
Always Open: no
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment