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

WIP: Issue 61 - Rename pillar.example to pillar-example.sls #62

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

getSurreal
Copy link

Proper extension for pillar files is .sls. Not using pillar.example.sls because the extra period is bad form for Salt.

@myii
Copy link
Member

myii commented Feb 28, 2019

Closes #61.


As an introduction to this PR, please consider the following comments captured on the issue behind this PR:

@daks
Copy link
Member

daks commented Feb 28, 2019

Good to me

@noelmcloughlin
Copy link
Member

Could it be named pillar-example.yaml instead? It does not & should not contain SLS code I guess

@myii
Copy link
Member

myii commented Feb 28, 2019

Could it be named pillar-example.yaml instead? It does not & should not contain SLS code I guess

@noelmcloughlin The issue with this is that the convention with actual pillar files is to use .sls.

@noelmcloughlin
Copy link
Member

Could it be named pillar-example.yaml instead? It does not & should not contain SLS code I guess

@noelmcloughlin The issue with this is that the convention with actual pillar files is to use .sls.

Okay, SLS then. I see pillar.example has qualifying comment: # vim: ft=yaml

@myii
Copy link
Member

myii commented Feb 28, 2019

Yes, it's not ideal that the file extension and content format diverge. But even changing from pillar.example => pillar-example.sls may be a step too far, due to existing conventions. Changing the extension of all pillar files to .yml may end up in mass rejection!

Out of interest, has anyone even tried accessing a pillar using .yml...?

@myii
Copy link
Member

myii commented Feb 28, 2019

As expected, it doesn't work for anything other than the .sls extension:

    Data failed to compile:
----------
    Pillar failed to render with the following messages:
----------
    Specified SLS 'template' in environment 'base' is not available on the salt master

@noelmcloughlin
Copy link
Member

noelmcloughlin commented Feb 28, 2019 via email

@myii
Copy link
Member

myii commented Feb 28, 2019

@noelmcloughlin Here's the code in salt/pillar/__init__.py, which calls salt/fileclient.py. Somehow, I don't think this is going to be changed any time soon...

@aboe76
Copy link
Member

aboe76 commented Feb 28, 2019

@myii , @getSurreal doesn't spm use the name pillar.example?

https://docs.saltstack.com/en/latest/topics/spm/dev.html#package-files

Copy link
Member

@aboe76 aboe76 left a comment

Choose a reason for hiding this comment

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

I see an issue with spm when we change this...
see: https://docs.saltstack.com/en/latest/topics/spm/dev.html#package-files

@myii
Copy link
Member

myii commented Feb 28, 2019

@aboe76 Yes, referenced literally in three places in [salt/spm/pkgfiles/local.py]:

  1. L82
  2. L120
  3. L148

Even if there was a PR to fix this, it wouldn't be available for a long time.

@myii myii changed the title Issue 61 - Rename pillar.example to pillar-example.sls WIP: Issue 61 - Rename pillar.example to pillar-example.sls Feb 28, 2019
@noelmcloughlin
Copy link
Member

Its officially a bug now: saltstack/salt#51910

Copy link
Member

@noelmcloughlin noelmcloughlin left a comment

Choose a reason for hiding this comment

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

Approving Thanks @getSurreal

@waynew
Copy link

waynew commented Mar 1, 2019

Okay, SLS then. I see pillar.example has qualifying comment: # vim: ft=yaml

That's a hint for Vim to use yaml formatting, since sls isn't a known Vim filetype. If you have a problem with the discrepancy the correct place to file a bug is wherever Vim filetypes are implemented.

sls files are a superset of yaml. If you have a .yaml file that you just really want to trade between systems then you can simply do ln -s yourfile.yaml somefile.sls (at least I'm pretty sure Salt reads symlinks - if not you just have to swap those things around).

@myii myii changed the base branch from master to develop July 24, 2019 21:45
@myii myii changed the base branch from develop to master October 13, 2019 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants