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

The xinetd module should not manage files if $package_ensure == absent #66

Closed
trevor-vaughan opened this issue May 20, 2022 · 4 comments · Fixed by #67
Closed

The xinetd module should not manage files if $package_ensure == absent #66

trevor-vaughan opened this issue May 20, 2022 · 4 comments · Fixed by #67
Labels

Comments

@trevor-vaughan
Copy link
Member

Ported over from PR creation by @bschonec in #65.

When uninstalling the xinetd package, this module attempts to manage /etc/xined.conf, /etc/xinetd.d/ files and attempts (in vain) to start the xinetd service.

I couldn't figure out how to open a new issue so I've commented the init.pp file appropriately and am asking for comments on this issue.

I have about 50 servers that need xinetd with the exception of one. In the node's YAML file, I've put "xinetd::package_ensure: absent" and the module fails because it's trying to manage the xinetd files when it shouldn't.

Yes, I realize I could write a conditional check NOT to include ::xinetd::service but then I'd eventually have spaghetti code trying to work around the module's bug. I'm kind of a purist and believe that the module should do no harm even when it's called and the packages don't need to be installed.

@trevor-vaughan trevor-vaughan self-assigned this May 20, 2022
trevor-vaughan added a commit to trevor-vaughan/pupmod-simp-xinetd that referenced this issue May 20, 2022
* Ensure that the module does not manage files if the package is being removed
* Added .rubocop.yml

Closes simp#66
@trevor-vaughan
Copy link
Member Author

@bschonec can you see if the PR in #67 does what you expect?

@bschonec
Copy link

bschonec commented May 20, 2022

Not yet. I got all kinds of errors. Notice that the module seems to want to restart the xinetd service. It's entirely possible that my system is so screwed up that the xinetd module can't recover my system.

Notice: /Stage[main]/Xinetd/Package[xinetd]/ensure: removed (corrective)
Notice: /Stage[main]/Xinetd/File[/etc/xinetd.conf]/ensure: defined content as '{sha256}e5a385d3997cc6501049df0016fb693af8f975da686450d731e7e3b57d79d20c' (corrective)
**Info: /Stage[main]/Xinetd/File[/etc/xinetd.conf]: Scheduling refresh of Service[xinetd]
Error: Systemd start for xinetd failed!**
journalctl log for xinetd:
-- Logs begin at Fri 2022-05-20 07:55:06 EDT, end at Fri 2022-05-20 15:54:53 EDT. --


<snip a bunch of stuff>

Error: /Stage[main]/Xinetd/Service[xinetd]/ensure: change from 'stopped' to 'running' failed: Systemd start for xinetd failed!
journalctl log for xinetd:
-- Logs begin at Fri 2022-05-20 07:55:06 EDT, end at Fri 2022-05-20 15:54:53 EDT. --

<snip a bunch of stuff>

Notice: /Stage[main]/Xinetd/Service[xinetd]: Triggered 'refresh' from 1 event
Info: Class[Xinetd]: Unscheduling all events on Class[Xinetd]

The RPM package xinetd will automatically stop the service upon its removal from RHEL type systems. It's probably not best practice to rely on that behavior in the Puppet module but not managing the service upon the package's removal might fix it for me.

@trevor-vaughan
Copy link
Member Author

@bschonec It seems unlikely that this change could cause that. The gist of the change is that, if the package is to be removed, that's the only thing that puppet will touch. Everything else is disabled.

@bschonec
Copy link

bschonec commented May 20, 2022

Indeed @trevor-vaughan you are correct. I had a typo in my Puppet file that was preventing R10k from pulling down your branch and Puppet was still using my crappy branch.

Your branch does fix the problems that I was experiencing.

Thank for submitting the code.

@trevor-vaughan trevor-vaughan removed their assignment May 20, 2022
@op-ct op-ct closed this as completed in #67 May 24, 2022
op-ct pushed a commit that referenced this issue May 24, 2022
* Honor package removal
* Ensure that the module does not manage files if the package is being removed
* Added .rubocop.yml
* fix the changelog
* raise timeout of FIPS jobs

Closes #66
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants