saltstack-formulas / salt-formula

Yes, Salt can Salt itself!
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
197 stars 423 forks source link

Ensure correct permissions for salt-cloud generated files #501

Closed pprkut closed 2 years ago

pprkut commented 3 years ago

PR progress checklist (to be filled in by reviewers)


What type of PR is this?

Primary type

Secondary type

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

Describe the changes you're proposing

salt-cloud creates the initial minion config and certificates with the permissions of the user it's connected as. These checks make sure the permissions are the same as in a non salt-cloud setup.

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

Documentation checklist

Testing checklist

Additional context

pprkut commented 3 years ago

Not sure about the failing tests :-/

It looks like on those systems the pki-dir is different from /etc/salt/pki, but no config (that I can find) that would define it. Am I missing something?

noelmcloughlin commented 2 years ago

@pprkut sorry for delay getting feedback. Could you add makedirs: true to your file.directory states?

The CI error is : No directory to create /etc/salt/pki/minion in

noelmcloughlin commented 2 years ago

ping @pprkut ;-)

pprkut commented 2 years ago

@noelmcloughlin Hi! I'm currently on vacation, but I'll pick this up once I'm back :)

pprkut commented 2 years ago

@noelmcloughlin Sorry, this took longer than I thought it would, but looks like the tests are indeed fixed now :)

pprkut commented 2 years ago

@vutny I think I have that covered now

pprkut commented 2 years ago

Hmm, the windows tests seem to stumble over the group now. I thought that was ignored on windows?

noelmcloughlin commented 2 years ago

Hello @pprkut Windows should be easy fix hopefully, see https://github.com/saltstack-formulas/docker-formula/pull/299/files Update: Actually windows is already supported, you just need to use {{ salt_settings.rootuser }} instead of "root".

noelmcloughlin commented 2 years ago

I think Windows group needs {% if grains['kernel'] != 'Windows' %} wrapped

pprkut commented 2 years ago

I see the windows states failing on this though:

The following packages failed to install/update: salt-minion-py3
pprkut commented 2 years ago

I'm afraid I'm a bit lost now on the windows failures :( Since one of them succeeded, I'm assuming it should work fine generally. The remaining failures look unrelated to my changes, but I can't be sure. Can someone with more knowledge about windows have a look?

myii commented 2 years ago

I'm afraid I'm a bit lost now on the windows failures :( Since one of them succeeded, I'm assuming it should work fine generally. The remaining failures look unrelated to my changes, but I can't be sure. Can someone with more knowledge about windows have a look?

@pprkut Yes, the failures are unrelated to your changes. Our Windows Vagrant boxes were updated to 3004 recently, which have led to these failures.

@noelmcloughlin @vutny Once you're happy with the proposed changes, please feel free to merge.

noelmcloughlin commented 2 years ago

Thanks @vutny for review. Thanks @pprkut for rescuing the PR.

saltstack-formulas-travis commented 2 years ago

:tada: This PR is included in version 1.10.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: