mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
fix invoke issues of Jinja Macros example
1.'php_ini' not defined in /srv/pillar/php.sls, {{ salt.pillar.get('php_ini', {}) | json() }} gets empty value. 2.no section defined, should be 'section_name'. 3.remove empty line.
This commit is contained in:
parent
3ca35d1ec3
commit
f08c875015
@ -680,10 +680,11 @@ example, the following macro could be used to write a php.ini config file:
|
|||||||
|
|
||||||
.. code-block:: yaml
|
.. code-block:: yaml
|
||||||
|
|
||||||
PHP:
|
php_ini:
|
||||||
engine: 'On'
|
PHP:
|
||||||
short_open_tag: 'Off'
|
engine: 'On'
|
||||||
error_reporting: 'E_ALL & ~E_DEPRECATED & ~E_STRICT'
|
short_open_tag: 'Off'
|
||||||
|
error_reporting: 'E_ALL & ~E_DEPRECATED & ~E_STRICT'
|
||||||
|
|
||||||
``/srv/salt/php.ini.tmpl``:
|
``/srv/salt/php.ini.tmpl``:
|
||||||
|
|
||||||
@ -691,8 +692,8 @@ example, the following macro could be used to write a php.ini config file:
|
|||||||
|
|
||||||
{% macro php_ini_serializer(data) %}
|
{% macro php_ini_serializer(data) %}
|
||||||
{% for section_name, name_val_pairs in data.items() %}
|
{% for section_name, name_val_pairs in data.items() %}
|
||||||
[{{ section }}]
|
[{{ section_name }}]
|
||||||
{% for name, val in name_val_pairs.items() %}
|
{% for name, val in name_val_pairs.items() -%}
|
||||||
{{ name }} = "{{ val }}"
|
{{ name }} = "{{ val }}"
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user