Skip to content

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

Description

@daks

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions