mirror of
https://github.com/saltstack-formulas/sysctl-formula.git
synced 2025-02-26 01:28:44 +01:00
Merge pull request #19 from babilen/empty-pillar-lookup
Check for presence of 'lookup' key
This commit is contained in:
commit
329323b1a3
@ -23,32 +23,33 @@ sysctl-present-{{ param_name }}:
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{## Support for legacy pillar structure ##}
|
{## Support for legacy pillar structure ##}
|
||||||
{%- if sysctl_settings.lookup.params2 is defined -%}
|
{%- if sysctl_settings.lookup is defined %}
|
||||||
|
{% if sysctl_settings.lookup.params2 is defined -%}
|
||||||
{%- for param_name, param in sysctl_settings.lookup.get('params2', {}).items() -%}
|
{%- for param_name, param in sysctl_settings.lookup.get('params2', {}).items() -%}
|
||||||
{%- if param is mapping %}
|
{%- if param is mapping %}
|
||||||
sysctl-present-{{ param_name }}:
|
sysctl-present-{{ param_name }}:
|
||||||
sysctl.present:
|
sysctl.present:
|
||||||
- name: {{ param_name }}
|
- name: {{ param_name }}
|
||||||
- value: {{ param.value }}
|
- value: {{ param.value }}
|
||||||
{%- if param.config is defined %}
|
{%- if param.config is defined %}
|
||||||
- config: {{ sysctl_settings.config.location }}/{{ param.config }}
|
- config: {{ sysctl_settings.config.location }}/{{ param.config }}
|
||||||
|
{% endif -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% endif -%}
|
{% endfor %}
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
{%- for param in sysctl_settings.lookup.get('params', {}) -%}
|
{%- for param in sysctl_settings.lookup.get('params', {}) -%}
|
||||||
{%- if param is mapping %}
|
{%- if param is mapping %}
|
||||||
sysctl-present-{{ param.name }}:
|
sysctl-present-{{ param.name }}:
|
||||||
sysctl.present:
|
sysctl.present:
|
||||||
- name: {{ param.name }}
|
- name: {{ param.name }}
|
||||||
- value: {{ param.value }}
|
- value: {{ param.value }}
|
||||||
{%- if param.config is defined %}
|
{%- if param.config is defined %}
|
||||||
- config: {{ sysctl_settings.config.location }}/{{ param.config }}
|
- config: {{ sysctl_settings.config.location }}/{{ param.config }}
|
||||||
|
{% endif -%}
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
{% endif -%}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endif -%}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user