Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
achinayoungwaubonsee opened this issue Oct 2, 2019 · 0 comments
Open

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

achinayoungwaubonsee opened this issue Oct 2, 2019 · 0 comments

Comments

@achinayoungwaubonsee
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant