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

feature request: add salt tops External Nodes Classifier #34

Open
Sjd-Risca opened this issue May 12, 2017 · 1 comment
Open

feature request: add salt tops External Nodes Classifier #34

Sjd-Risca opened this issue May 12, 2017 · 1 comment

Comments

@Sjd-Risca
Copy link

It would be nice if pillarstack could have a top module for generating the top file.

See here for detailed examples.

Here is what varstack does: /usr/lib/python2.7/dist-packages/salt/tops/varstack.py

@Sjd-Risca
Copy link
Author

It could be a nice idea.

At current state I usually circumvent such issue with the following salt/top.sls file:

{%- set base = salt.pillar.get('tops:base', []) %}
{%- if base|length > 0 %}
base:
    '*':
        {%- for role in base %}
        - {{ role }}
        {%- endfor %}
{% endif %}
{%- set dev = salt.pillar.get('tops:dev', []) %}
{%- if dev|length > 0 %}
dev:
    '*':
        {%- for role in dev %}
        - {{ role }}
        {%- endfor %}
{% endif %}

Whereas the pillar render to something like:

tops:
  base:
    - user
    - apache
user:
  ...
apache:
  ...

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