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

Added pillar option to redirect profile and map folders. #117

Merged
merged 6 commits into from
Apr 14, 2015

Conversation

andrew-vant
Copy link
Contributor

The default profile and map templates are neither terribly useful nor easy to add to without having to maintain your own fork or extension state. This patch makes the state use file.recurse for those folders (instead of assuming one file per provider) and allows the source property to be set. I don't think it can break existing salt trees.

I didn't include providers.d because the templates in there don't gracefully handle missing pillar data.

...but I'm not certain this is actually the best way to do this. I'm looking at the salt.cloud sls, and thinking that with a bit of refactoring the providers, profiles, maps, and file.directory section could all be collapsed into a single loop like the one in this commit -- and be both more flexible and require less pillar configuration afterward. That would be a breaking change, though, so I thought I'd ask if it's feasible before going to more effort.

Thoughts?

These aren't intended to function; they're here to allow the use of
file.recurse on the provider folder, without requiring the user
to provide pillar data for templates they're not using.
This obsoletes the salt:cloud:folders and salt:cloud:providers pillar
entries. Provider keys have been moved to /etc/salt/pki/cloud.
@andrew-vant
Copy link
Contributor Author

Okay, I lied, I went and implemented all of the above. I think this makes the salt.cloud state more flexible, shorter, and cleaner; and the provider and folders options are no longer required.

I'm not entirely sure if or how this would break existing configurations.

As mentioned in issue saltstack-formulas#118, provider files may contain passwords
or API keys and should be restricted. Profiles/maps are probably
OK with the defaults.
@andrew-vant
Copy link
Contributor Author

Updated PR to account for security issue noted in #118.

@andrew-vant
Copy link
Contributor Author

Could someone have a look at this? I'll understand if it won't fly, but feedback would be good.

@iggy
Copy link
Contributor

iggy commented Apr 13, 2015

It breaks backward compatibility and doesn't document that fact at all, much less how to convert the pillar data (aside from changing pillar.example values).

In general I'd like to see a lot more documentation about how this stuff works, some examples of actual use cases, etc.

template_sources:
providers: salt://templates/cloud.providers.d
profiles: salt://templates/cloud.profiles.d
maps: salt://templates/cloud.maps.d
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pillar.example generally follows the default. You should prefix these or something (salt://salt/files/cloud.maps.d would match what minion.sls and master.sls already do).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, I'll update it so these point to salt://salt/files/cloud.maps.d.

iggy added a commit that referenced this pull request Apr 14, 2015
Added pillar option to redirect profile and map folders.
@iggy iggy merged commit 15e63e8 into saltstack-formulas:master Apr 14, 2015
@iggy
Copy link
Contributor

iggy commented Apr 14, 2015

Thanks for the work. Looking forward to any further PRs you have.

@andrew-vant andrew-vant deleted the cloud-templates-redirect branch April 14, 2015 17:22
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