Change-Id: Ibd0a024bcd69089d9835a18f2bb803c952e13967pull/139/head
@@ -341,6 +341,41 @@ Ensure presence of directory: | |||
mode: 700 | |||
makedirs: true | |||
Ensure presence of file by specifying it's source: | |||
.. code-block:: yaml | |||
linux: | |||
system: | |||
file: | |||
/tmp/test.txt: | |||
source: http://example.com/test.txt | |||
user: root | |||
group: root | |||
file_mode: 700 | |||
dir_mode: 700 | |||
encoding: utf-8 | |||
hash: <<md5 hash>> | |||
makedirs: true | |||
Ensure presence of file by specifying it's contents: | |||
.. code-block:: yaml | |||
linux: | |||
system: | |||
file: | |||
/tmp/test.txt: | |||
contents: | | |||
line1 | |||
line2 | |||
user: root | |||
group: root | |||
file_mode: 700 | |||
dir_mode: 700 | |||
encoding: utf-8 | |||
hash: <<md5 hash>> | |||
makedirs: true | |||
Kernel | |||
~~~~~~ | |||
@@ -0,0 +1,34 @@ | |||
{%- from "linux/map.jinja" import system with context %} | |||
{%- if system.enabled %} | |||
{%- for file_name, file in system.file.iteritems() %} | |||
{{ file_name }}: | |||
file.managed: | |||
{%- if file.source is defined %} | |||
- source: {{ file.source }} | |||
{%- endif %} | |||
{%- if file.contents is defined %} | |||
- contents: {{ file.contents }} | |||
{%- endif %} | |||
- makedirs: {{ file.get('makedirs', 'True') }} | |||
- user: {{ file.get('user', 'root') }} | |||
- group: {{ file.get('group', 'root') }} | |||
{%- if file.file_mode is defined %} | |||
- file_mode: {{ file.file_mode }} | |||
{%- endif %} | |||
{%- if file.dir_mode is defined %} | |||
- dir_mode: {{ file.dir_mode }} | |||
{%- endif %} | |||
{%- if file.encoding is defined %} | |||
- encoding: {{ file.encoding }} | |||
{%- endif %} | |||
{%- if file.hash is defined %} | |||
- source_hash: {{ file.hash }} | |||
{%- else %} | |||
- skip_verify: True | |||
{%- endif %} | |||
{%- endfor %} | |||
{%- endif %} |
@@ -102,6 +102,9 @@ include: | |||
{%- if system.directory is defined %} | |||
- linux.system.directory | |||
{%- endif %} | |||
{%- if system.file is defined %} | |||
- linux.system.file | |||
{%- endif %} | |||
{%- if system.ld is defined %} | |||
- linux.system.ld | |||
{%- endif %} |