-
Notifications
You must be signed in to change notification settings - Fork 420
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
minion/master file.recurse needs to stop using clean: True #104
Comments
I think there should be a way to specify this in pillar with the default being clean:True |
The default will erase files that salt itself is writing out. So... that seems like a bad default to me. Maybe @thatch45 can weigh in on how important it is to keep that _schedule.conf file around or not (it was a commit from him that added that persist function). |
@iggy there can be config files present in that directory even before the installation of salt using salt-formula. If this is the case, we wouldn't want them to be there and would want salt-formula to put a set of new config files there. Perhaps backing up the old config files or maybe renaming them to have a .bak extension would be a good idea so if you want to recover the config file, you can do so manually. Thoughts @thatch45 @basepi ? |
Sounds like a good solution to me. Backups are always good. |
That doesn't answer the question of whether it's safe to just obliterate files that the salt master is writing. |
I haven't looked closely enough at this formula to know the answer to that question. Is this state running during salt-minion startup? Additionally, I don't think the minion writes files to this directory -- it only writes files to the pki directory as far as I know. |
I put a link to the code in the original post. It's utils.schedule doing it. It is definitely the minion doing the writing. I didn't write these files myself. The only thing I don't know is if these files shouldn't be erased (as they are now with this formula). |
Oh, I see, it must be a scheduled state run of some sort or something. |
I only meant that the main startup of the minion doesn't write those files. |
Let me know if you need more info.
|
I'm unlikely to do a PR for that seeing as I'm against it using "clean: True" to begin with. |
If you don't |
I agree with @basepi |
I understand where you guys are coming from. My issue is that the clean: True is going to wipe out files that salt is writing for a reason (presumably). |
So i'm reading this and is because salt minion has _schedule.conf in /etc/salt/minion.d Only thing I can think of is why salt-formula doesn't create _schedule.conf with configurable settings... @basepi and @nmadhok is _schedule.conf not basically the default mine scheduler of the minion? why is this even in a separate file? shouldn't this be default in /etc/salt/minion.... |
Well, having it in a different file means salt can manage the whole file. I just think this |
@basepi I think that is the most sensible approach, 👍 |
@iggy If you clone this formula on a fresh VM and install salt-minion using it, does it place From where did you get this config file? What generated it? Was it generated by salt-formula? |
I'm not beating this poor dead horse any more until basepi gets some input from thatch about why the minion is writing files to the config directory and whether that is going to change (but at this point, it's in a release, so we're stuck with it). |
@iggy Sure. Not a problem. |
Had a conversation this morning about |
New versions of Salt put config files in /etc/salt/{minion,master}.d. We don't want to erase them by using a clean: True on the file.recurse. This is a backward incompatible change, but it's necessary to avoid deleting Salt config files. Resolves saltstack-formulas#104
@basepi What should be the default? I still think it should be |
If it's |
@iggy I'm a little confused right now. When you install salt using the salt formula, does it create or place the config file that you're talking about? |
The way I understand it is, that file is the way that salt.states.schedule persists scheduled jobs across service restarts. So it's created by Salt itself (not the formula). |
Yep, it's completely independent of the formula, and ideally the formula shouldn't mess with it. The ideal solution is to have a whitelist for clean so it doesn't clean certain files but I don't think that functionality is available yet. |
Why not just use |
Actually, that's the correct fix. I was stuck on the first half of the
While it actually works on the clean as well:
|
It would probably be easier to just change the default. I've had a couple commits on top of this that might make it not revert cleanly. |
Ya, this is not a hard fix to make. =) |
And you'll have to rename _defaults.conf as it'll be excluded from the original copy (with |
Good point. |
@iggy Can you submit a PR with the appropriate changes? Change the defaults as well. Thanks for the awesome work! |
The salt code (and myself) put files in /etc/salt/{master,minion}.d
The "clean: True" is killing all that. It probably shouldn't do that.
The text was updated successfully, but these errors were encountered: