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

Pillars should be able to cross-reference to other pillars #1064

Closed
syphernl opened this issue Apr 9, 2012 · 3 comments
Closed

Pillars should be able to cross-reference to other pillars #1064

syphernl opened this issue Apr 9, 2012 · 3 comments
Labels
Feature new functionality including changes to functionality and code refactors, etc. stale
Milestone

Comments

@syphernl
Copy link
Contributor

syphernl commented Apr 9, 2012

My setup contains a global pillar that applies on * and a per-role one applied via role*.domain.tld.
In my global role there is a reference to a file containing master hostnames:

base:
    '*':
        - servers.masters
    'dns*':
        - match: pcre
        - server.localvars.dns

In the role-applied set (e.g. DNS servers) I want to be able to reference back to there.
So if the masterfile contains:

master_server: server1.master.tld

I'd like to be able to do this in the lower applied pillars:

some_global_var: bar
{% if grains['fqdn'] == pillar['master_server'] %}
some_local_var: foobarfoo
{% else %}
some_local_var: nothanks
{% endif %}

This allows for greater flexibility, otherwise I'd have to hardcode the master_server parameter in the localvars which I'm trying to avoid.

@SEJeff
Copy link
Contributor

SEJeff commented Apr 9, 2012

This would be a bit hairy to implement as pillar data is essentially merged together and then rendered as a whole. I'm not even 100% sure if this could be done.

@thatch45
Copy link
Contributor

thatch45 commented Apr 9, 2012

I see where you are coming from, but I am not sure this is going to be possible given the current setup, since pillar data is not read in a linear fashion, and there is not requisite construct. I will move this to 2.0.0 and think about how it can be done.

@stale
Copy link

stale bot commented Jun 4, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

@stale stale bot added the stale label Jun 4, 2018
@stale stale bot closed this as completed Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature new functionality including changes to functionality and code refactors, etc. stale
Projects
None yet
Development

No branches or pull requests

4 participants