Richard Felkl | 2e07d65 | 2018-01-19 10:19:06 +0100 | [diff] [blame] | 1 | {%- from "linux/map.jinja" import system with context %} |
| 2 | {%- if system.enabled %} |
| 3 | |
| 4 | {%- for file_name, file in system.file.iteritems() %} |
| 5 | |
| 6 | {{ file_name }}: |
| 7 | file.managed: |
| 8 | {%- if file.source is defined %} |
| 9 | - source: {{ file.source }} |
| 10 | {%- endif %} |
| 11 | {%- if file.contents is defined %} |
| 12 | - contents: {{ file.contents }} |
| 13 | {%- endif %} |
Bruno Binet | b0bc29e | 2018-02-02 17:16:26 +0100 | [diff] [blame^] | 14 | {%- if file.contents_pillar is defined %} |
| 15 | - contents_pillar: {{ file.contents_pillar }} |
| 16 | {%- endif %} |
Richard Felkl | 2e07d65 | 2018-01-19 10:19:06 +0100 | [diff] [blame] | 17 | - makedirs: {{ file.get('makedirs', 'True') }} |
| 18 | - user: {{ file.get('user', 'root') }} |
| 19 | - group: {{ file.get('group', 'root') }} |
| 20 | {%- if file.file_mode is defined %} |
| 21 | - file_mode: {{ file.file_mode }} |
| 22 | {%- endif %} |
| 23 | {%- if file.dir_mode is defined %} |
| 24 | - dir_mode: {{ file.dir_mode }} |
| 25 | {%- endif %} |
| 26 | {%- if file.encoding is defined %} |
| 27 | - encoding: {{ file.encoding }} |
| 28 | {%- endif %} |
| 29 | {%- if file.hash is defined %} |
| 30 | - source_hash: {{ file.hash }} |
| 31 | {%- else %} |
| 32 | - skip_verify: True |
| 33 | {%- endif %} |
| 34 | |
| 35 | {%- endfor %} |
| 36 | |
Bruno Binet | b0bc29e | 2018-02-02 17:16:26 +0100 | [diff] [blame^] | 37 | {%- endif %} |