linux-system-roles / firewall

Configure firewalld and system-config-firewall
https://linux-system-roles.github.io/firewall/
GNU General Public License v2.0
57 stars 32 forks source link

fix: make enabling/disabling non-existent services not fail in check mode #153

Closed BrennanPaciorek closed 1 year ago

BrennanPaciorek commented 1 year ago

Enhancement:

Reason: Better compliance with Ansible best practices for check mode (not failing in check mode, especially where they would not fail in diff mode) Reason for this particular solution - We cannot track changes from previous check modes without overhauling how check mode is handled throughout the entire system role.

Result: Undefined services being enabled or disabled will not result in failure while in check mode, but a warning will be displayed intended to prompt the user to confirm that the service is defined in a previous play, since the same action could result in failure when run in diff mode.

Issue Tracker Tickets (Jira or BZ if any):

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.23 :tada:

Comparison is base (f458cb4) 53.39% compared to head (11bc6ba) 53.62%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #153 +/- ## ========================================== + Coverage 53.39% 53.62% +0.23% ========================================== Files 2 2 Lines 796 800 +4 ========================================== + Hits 425 429 +4 Misses 371 371 ``` | Flag | Coverage Δ | | |---|---|---| | sanity | `∅ <ø> (∅)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=linux-system-roles#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://app.codecov.io/gh/linux-system-roles/firewall/pull/153?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=linux-system-roles) | Coverage Δ | | |---|---|---| | [library/firewall\_lib.py](https://app.codecov.io/gh/linux-system-roles/firewall/pull/153?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=linux-system-roles#diff-bGlicmFyeS9maXJld2FsbF9saWIucHk=) | `63.08% <100.00%> (+0.21%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

richm commented 1 year ago

ansible-lint: add var-naming[no-role-prefix] to skip_list in .ansible-lint

richm commented 1 year ago

[citest]

richm commented 1 year ago

You might find this useful - https://linux-system-roles.github.io/documentation/howto/working-with-ansible-jinja-code-and-filters.html - "How to solve some common ansible-lint issues"

richm commented 1 year ago

[citest]

spetrosi commented 1 year ago

ansible-lint: add var-naming[no-role-prefix] to skip_list in .ansible-lint

Should we add this in .github for all roles or am I missing something?

richm commented 1 year ago

ansible-lint: add var-naming[no-role-prefix] to skip_list in .ansible-lint

Should we add this in .github for all roles or am I missing something?

yes, we should - I don't see any other way around this, unfortunately

Alveel commented 1 year ago

Great work, thank you so much!