saltstack-formulas / template-formula

SaltStack formula template filled with dummy content

Home Page:http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add extension `.sls` or `.yml` to `pillar.example`

myii opened this issue · comments

Suggested by @getSurreal on our Slack/IRC/Matrix room from here:

22:47onslack
@myii With all the changes going on in template-formula, has anyone discussed renaming pillare.example to something like pillare_example.sls or .yml or something that will be recognized in an IDE?
22:48myii[m]
No-one has discussed that.
22:49myii[m]
Usually, you can set your IDE to recognise the file type.
22:53onslack
Of course that's true, just seems like an unnecessary workaround
22:58onslack
never even considered it :P_if_ you decide that it's worth, then I'd vote for pillar.example.yaml?
23:17onslack
@getSurreal Having thought about it, I think you're absolutely right. Why should anyone have to make any changes from their end? It should work out of the box.
23:17onslack
@javierbertoli Since all of the pillars end up as .sls files, shouldn't that be pillar.example.sls?
23:18onslack
@getSurreal Can you submit a PR or even an issue? You've got my backing and @javierbertoli's -- it's really just a matter of .yaml vs. .yml vs. .sls.
23:30onslack
@myii didn't thought about the pillars' extension, just the content of the file :-)Any extension that make sense has my vote, so I'm ok with pillar.example.sls too

@myii sorry I dropped off the slack feed and missed your request to create an issue.

I did have another thought on this. Isn't a '.' in the name bad form because salt interprets that as a directory. I prefer .sls since that's the correct extension for pillar files.

pillarexample.sls
pillar_example.sls
pillar-example.sls ( I'm leaning towards this one )

@getSurreal Since this file isn't processed by Salt, I'm easy either way. This is a file rename in any case, so the final naming can be locked down when reviewing the PR. I'm good with pillar-example.sls as well. Are you happy to submit the PR?

I understand the file isn't processed by Salt, but if it's bad form it sets a bad example.
I have no problem submitting a PR. I just thought I would wait a little for additional comments

We've already got some "bad examples" in the repo, albeit configuration files... commitlint.config.js and release.config.js, I'm looking at you! I know they're not directly related to Salt but just saying.

Anyway, a PR will definitely get more attention than an issue and it'll get out there quicker. This is a simple change so I propose that we collect the discussions there, if that's OK with you.

would docs(pillar): be the correct title?

Yes, that sounds right in this situation.

@getSurreal Hmm, we might have a problem renaming this file. As I was writing the last comment, I started out by writing refactor. It reminded me that I'd seen pillar.example used in Kitchen tests. So I did a little search:

So we've got it used in Kitchen tests but also in Dockerfile files and some shell scripts. It appears to be a convention that's relied upon. So at least we can cover that discussion point.

If you prefer to do that here rather than a PR, that's fine as well.

@myii I was aware of the change needed in kitchen.yml and included it in my PR, but I was not aware of the Docker changes needed. #62

@getSurreal Not a problem, it would be good to have this discussion in any case. Nothing is set in stone and it will give us a chance to explore moving towards the future with SaltStack Formulas. Thanks for the PR, we'll continue the discussion there.

commented

Could it be renamed from pillar.example to user.example as well? Some more friendly terminology.