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

How to reference pillar files? #14980

Closed
srkunze opened this issue Aug 14, 2014 · 8 comments
Closed

How to reference pillar files? #14980

srkunze opened this issue Aug 14, 2014 · 8 comments
Labels
won't-fix legitimate issue, but won't fix
Milestone

Comments

@srkunze
Copy link
Contributor

srkunze commented Aug 14, 2014

As far as I my knowledge goes, we can identify files the following ways:

salt://my/file <<< that is below /srv/salt/ on the master
/my/file <<< that is below / on the mininion

How can we reference files under /srv/pillar/?
Would it make a difference when using git-pillars?

I could not find any thing in the docs regarding this.

@srkunze
Copy link
Contributor Author

srkunze commented Aug 14, 2014

Just to make clear, what our intention is. Is there something like pillar://my/file that we might have overseen?

We would like to be able to use the git-pillar to query necessary data from it like tags, branches, files etc.

@srkunze srkunze changed the title How to use pillar files? How to reference pillar files? Aug 14, 2014
@gtmanfred
Copy link
Contributor

You don't reference files in pillars, you reference the data in lists and
dictionaries inside the files.
On Aug 14, 2014 3:14 AM, "Sven R. Kunze" notifications@github.com wrote:

As far as I my knowledge goes, we can identify files the following ways:

salt://my/file <<< that is below /srv/salt/ on the master
/my/file <<< that is below / on the mininion

How can reference files under /srv/pillar/?
Would it make a difference when using git-pillars?

I could not find any thing on the docs regarding this.


Reply to this email directly or view it on GitHub
#14980.

@srkunze
Copy link
Contributor Author

srkunze commented Aug 14, 2014

Thank you for your kind response.

Unfortunately, what do we do if we have a template snippet or other important files somewhere in the pillars directory? How can we access those in our sls files?

Furthermore, how to use git (capabilities provided by http://docs.saltstack.com/en/latest/ref/pillar/all/salt.pillar.git_pillar.html are quite limited) on those pillar directories?

@gtmanfred
Copy link
Contributor

https://github.com/mparker1001/loadtester-salt/blob/master/loadmaster/pillar.example#L10

In this one that a friend of mine wrote, you add the ssh public and private keys to pillars, we then drop the pillar into a file here.

https://github.com/mparker1001/loadtester-salt/blob/master/loadmaster/init.sls#L91

So you can reference your stuff with yaml blocks or you can cycle through the data like he does in the top of the init.sls file.

@srkunze
Copy link
Contributor Author

srkunze commented Aug 14, 2014

Thank you again. I will into it tomorrow and provide some feedback.

@srkunze
Copy link
Contributor Author

srkunze commented Aug 15, 2014

Alright. I had a look at your friend's approach. It seems doable this way; so, thank you and your friend again.

However, I dislike this solution because it feels like a dirty work-around.

Is there no Salty way to do it?

@basepi
Copy link
Contributor

basepi commented Aug 15, 2014

The issue with this, is pillar data is considered sensitive, and is restricted based on the minion in question. If minions were able to just reference files in that directory, it would be a pretty big security issue, because they could get at files that they're not supposed to.

Instead, if you need to fill the contents of a file with something from pillar, define it in the pillar for that minion, and then use file.managed with the contents_pillar argument to fill the file with the contents of a pillar key.

We will not be adding support for direct pillar:// file access -- though I could potentially see something like pillar://mypillarkey being a shortcut for contents_pillar.

@srkunze
Copy link
Contributor Author

srkunze commented Mar 25, 2015

Next issue wanting a solution to this: #18406

@srkunze srkunze closed this as completed Jan 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
won't-fix legitimate issue, but won't fix
Projects
None yet
Development

No branches or pull requests

3 participants