Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ansible-lint - use changed_when even for tasks with conditionals #326

Merged
merged 2 commits into from
Apr 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions roles/rsyslog/tasks/inputs/ovirt/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@
when:
- __rsyslog_input.type | d() == 'ovirt'
- ansible_selinux.mode in ["enforcing", "permissive"]
changed_when: true
notify: Restart rsyslogd
1 change: 1 addition & 0 deletions tests/tasks/check_daemon_config_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@
when: __check_systemctl_status == "true"
failed_when: "'error' in __result.stdout or 'a RainerScript command'
in __result.stdout or __result is failed"
changed_when: false
1 change: 1 addition & 0 deletions tests/tests_basics_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@
#
# Ansible managed
#
# system_role:logging
ruleset(name="forwards_severity_and_facility") {
local1.info action(name="forwards_severity_and_facility"
type="omfwd"
Expand Down
8 changes: 8 additions & 0 deletions tests/tests_basics_forwards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@
#
# Ansible managed
#
# system_role:logging
ruleset(name="forwards_severity_and_facility") {
local1.info action(name="forwards_severity_and_facility"
type="omfwd"
Expand All @@ -166,6 +167,7 @@
#
# Ansible managed
#
# system_role:logging
ruleset(name="forwards_facility_only") {
local2.* action(name="forwards_facility_only"
type="omfwd"
Expand All @@ -188,6 +190,7 @@
#
# Ansible managed
#
# system_role:logging
ruleset(name="forwards_severity_only") {
*.err action(name="forwards_severity_only"
type="omfwd"
Expand All @@ -210,6 +213,7 @@
#
# Ansible managed
#
# system_role:logging
ruleset(name="forwards_no_severity_and_facility") {
*.* action(name="forwards_no_severity_and_facility"
type="omfwd"
Expand All @@ -232,6 +236,7 @@
#
# Ansible managed
#
# system_role:logging
ruleset(name="forwards_no_severity_and_facility_udp") {
*.* action(name="forwards_no_severity_and_facility_udp"
type="omfwd"
Expand All @@ -255,6 +260,7 @@
#
# Ansible managed
#
# system_role:logging
ruleset(name="forwards_no_severity_and_facility_protocol_port") {
*.* action(name="forwards_no_severity_and_facility_protocol_port"
type="omfwd"
Expand Down Expand Up @@ -375,6 +381,7 @@
#
# Ansible managed
#
# system_role:logging
ruleset(name="forwards_severity_and_facility") {
local1.info action(name="forwards_severity_and_facility"
type="omfwd"
Expand Down Expand Up @@ -492,6 +499,7 @@
#
# Ansible managed
#
# system_role:logging
ruleset(name="forwards_severity_and_facility") {
local1.info action(name="forwards_severity_and_facility"
type="omfwd"
Expand Down
2 changes: 2 additions & 0 deletions tests/tests_combination.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@
#
# Ansible managed
#
# system_role:logging
ruleset(name="forwards_severity_and_facility") {
local1.info action(name="forwards_severity_and_facility"
type="omfwd"
Expand Down Expand Up @@ -311,6 +312,7 @@
#
# Ansible managed
#
# system_role:logging
ruleset(name="forwards_severity_and_facility") {
local1.info action(name="forwards_severity_and_facility"
type="omfwd"
Expand Down