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.
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
/etc/resolv.confresolverstate and see that no changes has been applied/etc/resolv.confis still edited and not equal to the salt configurationExpected behaviour
I want this formula to force the correct configuration of resolvconf/resolv.conf on the minions
Attempts to fix the bug
Running
resolvconf -udo 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 theresolv-filehas changed.This
resolv-fileis not/etc/resolv.confbut, on debian 11, it's/etc/resolvconf/resolv.conf.d/baseand, because it's has not changed, theresolvconf -udo not run.Additional context
Running
resolvconf -uat 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.