Skip to content

Use of __salt__['pillar.filter_by'] in pillar stack #55

Description

@achinayoungwaubonsee

We have salt 2019.2.0:

# salt --version
salt 2019.2.0 (Fluorine)

/srv/pillar/stack/httpd.yml has:

# cat /srv/pillar/stack/httpd.yml
{% load_yaml as httpd_definitions %}
web_servers:
  enable: true

default:
  enable: false
{% endload %}

{% set httpdnew = __salt__['pillar.filter_by'](httpd_definitions,
                                               pillar='roles') %}
httpdold:
{% if (pillar.get('roles') and
       ('web_servers' in pillar.get('roles'))) %}
  enable: true
{% endif %}

httpdnew: {{ httpdnew | json() }}

# salt <id> pillar.items
    httpdnew:
        ----------
        enable:
            False
    httpdold:
        ----------
        enable:
            True
    roles:
        - web_servers
        - dev_web_servers

Why isn't __salt__['pillar.filter_by'] working? I would expect httpdnew.enable=True, the same as httpdold.enable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions