Skip to content

Commit

Permalink
Merge pull request #22 from makinacorpus/stable
Browse files Browse the repository at this point in the history
Stable
  • Loading branch information
kiorky committed Feb 5, 2016
2 parents ce2dcb3 + 2f9c757 commit 38440fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions _macros/h.jinja
Expand Up @@ -3,23 +3,27 @@
dir='makina-states/files',
after_macro=None,
user='root',
target_prefix="",
group='root',
mode=750,
makedirs=True,
template='jinja') %}
{# retrocompatible kwargs access, either from direct in the template or from the "data" variable #}
{% set inline_jkwargs = salt['mc_utils.deepcopy'](kwargs) %}
{% do inline_jkwargs.pop('data', None) %}
{% do inline_jkwargs.update({'data': kwargs}) %}

{% for f, fdata in confs.items() %}
{% set templated = fdata.get('template', template) %}
{{prefix}}{{f}}:
file.managed:
- name: "{{fdata.get('target', f)}}"
- name: "{{fdata.get('target', "{0}{1}".format(target_prefix, f))}}"
- source: "{{fdata.get('source', 'salt://{0}{1}'.format(dir, f))}}"
- mode: "{{fdata.get('mode', mode)}}"
- user: "{{fdata.get('user', user)}}"
- group: "{{fdata.get('group', group)}}"
{% if kwargs %}
- context:
data: |
{{ kwargs | json }}
- context: {{inline_jkwargs | json }}
{% endif %}
{% if fdata.get('makedirs', makedirs) %}
- makedirs: true
Expand Down
2 changes: 1 addition & 1 deletion files/projects/2/salt/fixperms.sls
Expand Up @@ -61,7 +61,7 @@
- user: root
- mode: 744
- contents: |
{{cfg.data.fixperms_cron_periodicity}} root {{cfg.project_dir}}/global-reset-perms.sh
{{cfg.data.fixperms_cron_periodicity}} root {{cfg.project_dir}}/global-reset-perms.sh >/dev/null 2>&1
{%else%}
file.absent:
- name: /etc/cron.d/{{cfg.name.replace('.', '_')}}-fixperms
Expand Down

0 comments on commit 38440fd

Please sign in to comment.