1
1
Fork 0
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2024-05-08 23:46:02 +02:00

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.
This commit is contained in:
Evangelos Foutras 2023-03-26 16:57:00 +03:00
parent 1507dd48f9
commit 4ae73a93be
No known key found for this signature in database
GPG Key ID: 51E8B148A9999C34
8 changed files with 12 additions and 12 deletions

View File

@ -1,7 +1,7 @@
- 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

View File

@ -1,7 +1,7 @@
- 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

View File

@ -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

View File

@ -1,2 +1,2 @@
- name: Apply sysctl settings
- name: Apply sysctl settings # noqa no-changed-when
command: sysctl --system

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,4 @@
- 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 }}"

View File

@ -1,10 +1,10 @@
# 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