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

[BUG] Formula does not reconfigure in case of manual edition of /etc/resolv.conf #41

Open
daks opened this issue Jan 13, 2023 · 0 comments
Labels

Comments

@daks
Copy link
Member

daks commented Jan 13, 2023

Your setup

Formula commit hash / release tag

master

Versions reports (master & minion)

not significant

Pillar / config used

whatever pillar


Bug details

Describe the bug

When using the formula, if a user manually edits /etc/resolv.conf, the formula does not detect it and does not apply the salt configuration.

Steps to reproduce the bug

  • Use resolver-formula with whatever pillars, and apply the configuration to the minion.
  • Log into the minion and edit /etc/resolv.conf
  • reapply resolver state and see that no changes has been applied
  • on the minion, see that /etc/resolv.conf is still edited and not equal to the salt configuration

Expected behaviour

I want this formula to force the correct configuration of resolvconf/resolv.conf on the minions

Attempts to fix the bug

Running resolvconf -u do the job, overring the /etc/resolv.conf. This command is run by the formula (see https://github.com/saltstack-formulas/resolver-formula/blob/master/resolver/init.sls#L48) but only if the resolv-file has changed.

This resolv-file is not /etc/resolv.conf but, on debian 11, it's /etc/resolvconf/resolv.conf.d/base and, because it's has not changed, the resolvconf -u do not run.

Additional context

Running resolvconf -u at every salt run is not perfect (it runs a command everytime, even when it's not needed) but the current behaviour seems worse to me: salt do not return any error or change and the resolver configuration is still wrong on the minion.

I think we can imagine having a pillar/parameter to force the run of this command at every salt run.

@daks daks added the bug label Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant