Skip to content

Add support for default node fallback. #43

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

Closed
wants to merge 1 commit into from
Closed

Add support for default node fallback. #43

wants to merge 1 commit into from

Conversation

notpeter
Copy link

Add an additional optional configuration parameter 'default_node' which when a node is lacks a yml config file it falls back to provide data from this default node. The point of this is to allow the equivalent of '*': in a salt pillar/top.sls file. With this patch you can still target pillar data to minions which you don't have corresponding minion_id nodes defined. Either by hard coding parameters/classes in the default_node yaml file or with class_mappings regexes in the reclass-config.yml.

This parameter defaults to None when unset. This causes the same behavior as pre-patch (exception thrown on node not found).

I haven't pushed this change into the salt top module because I don't use this functionality and so can't easily test. I believe this behavior could be implemented by adding a default_node kwarg to top() and when storage adaptor is initialized. I don't have ansible infrastructure to test with so I've made no changes to the ansible/* code. reclass-ansible behavior appears unchanged (as expected) since it's just ignoring an extra kwarg passed from the cli module.

@madduck
Copy link
Owner

madduck commented Feb 12, 2015

The problem here is that now reclass cannot enumerate all nodes anymore. At the moment, Salt cannot use this functionality, since it actually doesn't track which nodes it contacts (Ouch! saltstack/salt#2361), but other tools supported by reclass certainly do.

There was another idea floating around, #9 and #25, i.e. node aliases. This could be extended to support enumeration globs, e.g. you create a file default_www.yml and in it, you define e.g.

applies_to:
    - www.{000..999}.*

How do you feel about that?

@notpeter notpeter closed this Aug 21, 2015
AndrewPickford pushed a commit to AndrewPickford/reclass that referenced this pull request Sep 11, 2018
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

Successfully merging this pull request may close these issues.

2 participants