title: Saltstack load pillar in a for loop
body: <p>I am developing a automatic proftd installation whit Salt, i wont to get the ftp users from a template but I cant get work the pillar, i initialized the pillar whit the users data and call it into a for loop, but you don't get the pillar user data in the loop.</p>
  
  <p>When i make  salt-call pillar.get ftpusers in the minion, the response is:</p>
  
  <p>local:</p>
  
  <p>This is my pillar ftpusers.sls:</p>
  
  <pre><code>ftp-server.ftpusers:
    user:
      - user: user
      - passhash: j2k3hk134123l1234ljh!"·$ser
      - uuid: 1001
      - guid: 1001
      - home: /srv/ftp/user
      - shel: /bin/false
  </code></pre>
  
  <p>And this is the for loop:</p>
  
  <pre><code>{% for users in pillar.get('ftpusers', {}).items() %}
  
    /srv/herma-ftp/.ftpusers:
      file.managed:
        - user: root
        - group: root
        - mode: 444
        - contents:'{{ user }}:{{ args['passhash'] }}:{{args['uuid'] }}:{{ args['guid'] }}::{{ args['home'] }}:{{ args['shel'] }}'
        - require:
          - file: /srv/herma-ftp
  
    /srv/herma-ftp/{{user}}:
      file.directory:
        - user: nobody
        - group: nobody
        - dir_mode: 775
        - makedirs: True
        - require:
          - file: /srv/herma-ftp
        - watch:
          - file: /srv/herma-ftp
      module.run:
        - name: file.set_selinux_context
        - path: {{ args['home']}}
        - type: public_content_t
        - unless:
          - stat -c %C {{ args['home'] }} |grep -q public_content_t
  
  {% endfor %}
  </code></pre>
  
  <p>When I make in the minion </p>
  
  <pre><code>salt-call -l debug state.sls herma-ftp-server saltenv=My-enviroment test=True
  </code></pre>
  
  <p>Don't expect this for because don't can get the pillar data. </p>