Skip to content

fix: purge only unmanaged files - #324

Open
sir-ragna wants to merge 1 commit into
saltstack-formulas:masterfrom
sir-ragna:master
Open

sir-ragna wants to merge 1 commit into
saltstack-formulas:masterfrom
sir-ragna:master

Conversation

@sir-ragna

@sir-ragna sir-ragna commented Sep 30, 2026 •

Copy link
Copy Markdown

PR progress checklist (to be filled in by reviewers)

  • Changes to documentation are appropriate (or tick if not required)
  • Changes to tests are appropriate (or tick if not required)
  • Reviews completed

What type of PR is this?

Primary type

  • [build] Changes related to the build system
  • [chore] Changes to the build process or auxiliary tools and libraries such as documentation generation
  • [ci] Changes to the continuous integration configuration
  • [feat] A new feature
  • [fix] A bug fix
  • [perf] A code change that improves performance
  • [refactor] A code change that neither fixes a bug nor adds a feature
  • [revert] A change used to revert a previous commit
  • [style] Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)

Does this PR introduce a BREAKING CHANGE?

No.

Describe the changes you're proposing

Fixes the nginx:servers:purge_servers_config: true feature. I believe this feature has been broken for the majority of the time that it existed.

My original idea was to avoid a similar issue that I fixed in the strongswan-formula (saltstack-formulas/strongswan-formula#11) to avoid removing and then recreating the same files.

In this case however, the feature was broken in general and this also fixes the functionality in general.

I added a test and set up the environment by creating test/salt/default/states/test_dep/create_unmanaged_conf_file.sls. I prefer this pattern over using init_environment: in the kitchen file, like I did in the strongswan-formula.

Documentation checklist

  • Updated the README (e.g. Available states).
  • Updated pillar.example.

Testing checklist

  • Included in Kitchen (i.e. under state_top).
  • Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).
  • Updated the relevant test pillar.

Additional context

This feature was originally introduced here: #263

@sir-ragna
sir-ragna requested review from a team and sticky-note as code owners September 30, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants