Skip to content
Snippets Groups Projects
Verified Commit 4ae73a93 authored by Evangelos Foutras's avatar Evangelos Foutras :smiley_cat:
Browse files

ansible-lint: address no-changed-when fatal errors

Add "noqa no-changed-when" tags to handlers using the command module.
Perhaps it is wrong of ansible-lint to flag these, since handlers are
not the best place to have conditional execution.
parent 1507dd48
No related branches found
No related tags found
No related merge requests found
- name: Restart php-fpm@archwiki
service: name=php-fpm@{{ archwiki_user }} state=restarted
- name: Run wiki updatescript
- name: Run wiki updatescript # noqa no-changed-when
command: php {{ archwiki_dir }}/public/maintenance/update.php --quick
become: true
become_user: "{{ archwiki_user }}"
......@@ -14,7 +14,7 @@
# otherwise nginx will spit errors into the log until it is restarted (even
# reload is not enough).
# reference: https://stackoverflow.com/a/6896903
- name: Purge nginx cache
- name: Purge nginx cache # noqa no-changed-when
command: find /var/lib/nginx/cache -type f -delete
# The MediaWiki file cache can be invalidated by deleting the files in the
......
- name: Reload dovecot
service: name=dovecot state=restarted
- name: Run sievec
- name: Run sievec # noqa no-changed-when
command: /usr/bin/sievec /etc/dovecot/sieve/{{ item }}
loop:
- spam-to-folder.sieve
......@@ -3,5 +3,5 @@
name: fail2ban
state: restarted
- name: Reload fail2ban jails
- name: Reload fail2ban jails # noqa no-changed-when
shell: type fail2ban-server > /dev/null && (fail2ban-client ping > /dev/null && fail2ban-client reload > /dev/null || true) || true
- name: Apply sysctl settings
- name: Apply sysctl settings # noqa no-changed-when
command: sysctl --system
......@@ -7,7 +7,7 @@
- name: Reload postfix
service: name=postfix state=reloaded
- name: Run postmap
- name: Run postmap # noqa no-changed-when
command: postmap /etc/postfix/{{ item }}
loop:
- aliases
......@@ -3,10 +3,10 @@
name: postfix
state: restarted
- name: Reload postfix
- name: Reload postfix # noqa no-changed-when
command: postfix reload
- name: Postmap additional files
- name: Postmap additional files # noqa no-changed-when
command: postmap /etc/postfix/{{ item }}
with_items:
- access_client
......@@ -19,5 +19,5 @@
- domains
- msa_header_checks
- name: Update aliases db
- name: Update aliases db # noqa no-changed-when
command: postalias /etc/postfix/aliases
- name: Upgrade database
- name: Upgrade database # noqa no-changed-when
become: true
become_user: security
command: /usr/bin/make db-upgrade chdir="{{ security_tracker_dir }}"
......
# https://github.com/systemd/systemd/issues/9627
- name: Delete wg0
- name: Delete wg0 # noqa no-changed-when
command: networkctl delete wg0
register: result
failed_when: result.rc not in [0, 1]
listen: Reload wireguard
- name: Reload .network and .netdev files
- name: Reload .network and .netdev files # noqa no-changed-when
command: networkctl reload
listen: Reload wireguard
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment