title: Read from SaltStack pillar files
body: <p>I've just installed a vanilla SaltStack master and minions. I'm trying to follow the instructions on <a href="https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html" rel="nofollow noreferrer">https://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html</a> to create a very basic PHP state.</p>
  
  <p><code>/srv/salt/php.sls</code>:</p>
  
  <pre><code>php_ini:
    file.managed:
      - name: /etc/php.ini
      - source: salt://php.ini.tmpl
      - template: jinja
      - context:
          php_ini_settings: {{ salt.pillar.get('php_ini', {}) | json() }}
  </code></pre>
  
  <p><code>/srv/pillar/php.sls</code>:</p>
  
  <pre><code>php_ini:
    PHP:
      engine: 'On'
      short_open_tag: 'Off'
      error_reporting: 'E_ALL &amp; ~E_DEPRECATED &amp; ~E_STRICT'
  </code></pre>
  
  <p><code>/srv/salt/php.ini.tmpl</code>:</p>
  
  <pre><code>{% macro php_ini_serializer(data) %}
  {% for section_name, name_val_pairs in data.items() %}
  [{{ section_name }}]
  {% for name, val in name_val_pairs.items() -%}
  {{ name }} = "{{ val }}"
  {% endfor %}
  {% endfor %}
  {% endmacro %}
  
  ; File managed by Salt at &lt;{{ source }}&gt;.
  ; Your changes will be overwritten.
  
  {{ php_ini_serializer(php_ini_settings) }}
  </code></pre>
  
  <p>The output file looks like this:</p>
  
  <pre><code>VVV File starts on the next line
  
  
  ; File managed by Salt at &lt;salt://php.ini.tmpl&gt;.
  ; Your changes will be overwritten.
  
  
  
  ^^^ File ends on the previous line
  </code></pre>
  
  <p>I've added extra lines so that Stack Overflow will display the blank lines in the output file correctly.</p>
  
  <p>I would expect it to look something link this:</p>
  
  <pre><code>VVV File starts on the next line
  
  
  ; File managed by Salt at &lt;salt://php.ini.tmpl&gt;.
  ; Your changes will be overwritten.
  
  [PHP]
  engine = "On"
  short_open_tag = "Off"
  error_reporting = "E_ALL &amp; ~E_DEPRECATED &amp; ~E_STRICT"
  
  
  ^^^ File ends on the previous line
  </code></pre>
  
  <p>It appears that Salt isn't reading the pillar file at all. What have I done wrong?</p>