fix: Skip the loopback profile when deleting all profiles except the ones explicitly included#813
Merged
richm merged 1 commit intolinux-system-roles:mainfrom Oct 7, 2025
Merged
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR updates the 'absent' action in the network_connections module to exclude the loopback interface ('lo') from deletion, preventing a spurious 'changed' state each run when the system auto-recreates it. Flow diagram for updated profile deletion logic (excluding loopback)flowchart TD
A["Start profile deletion (absent action)"] --> B["Get non-absent profile names"]
B --> C["Add 'lo' (loopback) to blacklist"]
C --> D["Iterate over all network profiles"]
D --> E["If profile is in blacklist, skip deletion"]
D --> F["If profile is not in blacklist, delete profile"]
E --> G["End"]
F --> G["End"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #813 +/- ##
==========================================
+ Coverage 43.11% 43.22% +0.10%
==========================================
Files 12 12
Lines 3124 3123 -1
==========================================
+ Hits 1347 1350 +3
+ Misses 1777 1773 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
liangwen12year
approved these changes
Oct 2, 2025
…cept explicitly included - address linux-system-roles#689 Signed-off-by: Emilio Palumbo <emiliopalumbo@gmail.com>
Contributor
|
[citest] |
richm
approved these changes
Oct 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enhancement: This PR adds the
loopbackdevice toblack_list_nameswhen deleting all profiles except the ones explicitly included in the ansible playbookReason: Adding an entry without a name and
persistent_state: absentto thenetwork_connectionsvariables would trigger achangedstate in one of the tasksThis was because the profile
loopbackdevice was being removed and then automatically recreated by the system.Result: Now the loopback profile is kept and the state is not reported as
changed:Issue Tracker Tickets (GitHub issue): #689
Summary by Sourcery
Keep the loopback network profile from being deleted when purging absent profiles to prevent false-positive changes in Ansible playbooks
Bug Fixes:
Enhancements: