blob: 0de42fe9ea27267df3094e0af125011f883d041a [file] [log] [blame]
{%- from "linux/map.jinja" import system with context %}
{%- if system.enabled %}
{%- for file_name, file in system.file.items() %}
linux_file_{{ file_name }}:
file.managed:
{%- if file.name is defined %}
- name: {{ file.name }}
{%- else %}
- name: {{ file_name }}
{%- endif %}
{%- if file.source is defined %}
- source: {{ file.source }}
{%- if file.hash is defined %}
- source_hash: {{ file.hash }}
{%- else %}
- skip_verify: True
{%- endif %}
{%- elif file.contents is defined %}
- contents: {{ file.contents|yaml }}
{%- elif file.contents_pillar is defined %}
- contents_pillar: {{ file.contents_pillar }}
{%- elif file.contents_grains is defined %}
- contents_grains: {{ file.contents_grains }}
{%- endif %}
- makedirs: {{ file.get('makedirs', 'True') }}
- user: {{ file.get('user', 'root') }}
- group: {{ file.get('group', 'root') }}
{%- if file.mode is defined %}
- mode: {{ file.mode }}
{%- endif %}
{%- if file.dir_mode is defined %}
- dir_mode: {{ file.dir_mode }}
{%- endif %}
{%- if file.encoding is defined %}
- encoding: {{ file.encoding }}
{%- endif %}
{%- endfor %}
{%- endif %}