Changeset - 945973223a21
[Not reviewed]
0 6 0
Branko Majic (branko) - 3 years ago 2021-01-12 23:46:17
branko@majic.rs
MAR-163: Reformat skip-QA directives for ANSIBLE0012 (Commands should not change things if nothing needs doing):

- Update codes used to identify the disabled QA checks.
- Switch to using new syntax that disables only a specific QA check
instead of all of them on a single task.
- Drop disabling QA checks on two command tasks, since they actually
use the "creates" directive (therefore passing the QA check).
6 files changed with 30 insertions and 52 deletions:
0 comments (0 inline, 0 general)
roles/backup_client/handlers/main.yml
Show inline comments
 
@@ -3,15 +3,13 @@
 
# @TODO: Can't use file module, since one of the files (GnuPG socket)
 
#        seems to disappear in middle of operation).
 
- name: Remove current keyring
 
  command: "rm -rf /etc/duply/main/gnupg"
 
  command: "rm -rf /etc/duply/main/gnupg"  # noqa 301
 
  # [301] Commands should not change things if nothing needs doing
 
  #   This task is invoked only if user is very specific about requiring to
 
  #   run the handlers manually as a way to bring the system to consistency
 
  #   after interrupted runs.
 
  args:
 
    warn: false
 
  tags:
 
    # [ANSIBLE0012] Commands should not change things if nothing needs doing
 
    #   This task is invoked only if user is very specific about requiring to
 
    #   run the handlers manually as a way to bring the system to consistency
 
    #   after interrupted runs.
 
    - skip_ansible_lint
 

	
 
- name: Create keyring directory
 
  file:
 
@@ -22,13 +20,11 @@
 
    mode: 0700
 

	
 
- name: Import private keys
 
  command: "gpg --no-tty --homedir /etc/duply/main/gnupg --import /etc/duply/main/private_keys.asc"
 
  tags:
 
    # [ANSIBLE0012] Commands should not change things if nothing needs doing
 
    #   This task is invoked only if user is very specific about requiring to
 
    #   run the handlers manually as a way to bring the system to consistency
 
    #   after interrupted runs.
 
    - skip_ansible_lint
 
  command: "gpg --no-tty --homedir /etc/duply/main/gnupg --import /etc/duply/main/private_keys.asc"  # noqa 301
 
  # [301] Commands should not change things if nothing needs doing
 
  #   This task is invoked only if user is very specific about requiring to
 
  #   run the handlers manually as a way to bring the system to consistency
 
  #   after interrupted runs.
 

	
 
- name: Import public keys
 
  command: "gpg --no-tty --homedir /etc/duply/main/gnupg --import /etc/duply/main/public_keys.asc"
roles/common/handlers/main.yml
Show inline comments
 
---
 

	
 
- name: Update PAM configuration
 
  command: "/usr/sbin/pam-auth-update --package"
 
  tags:
 
    # [ANSIBLE0012] Commands should not change things if nothing needs doing
 
    #   This task is invoked only if user is very specific about requiring to
 
    #   run the handlers manually as a way to bring the system to consistency
 
    #   after interrupted runs.
 
    - skip_ansible_lint
 
  command: "/usr/sbin/pam-auth-update --package"  # noqa 301
 
  # [301] Commands should not change things if nothing needs doing
 
  #   This task is invoked only if user is very specific about requiring to
 
  #   run the handlers manually as a way to bring the system to consistency
 
  #   after interrupted runs.
 

	
 
- name: Restart SSH
 
  service:
 
@@ -15,13 +13,11 @@
 
    state: restarted
 

	
 
- name: Update CA certificate cache
 
  command: "/usr/sbin/update-ca-certificates --fresh"
 
  tags:
 
    # [ANSIBLE0012] Commands should not change things if nothing needs doing
 
    #   This task is invoked only if user is very specific about requiring to
 
    #   run the handlers manually as a way to bring the system to consistency
 
    #   after interrupted runs.
 
    - skip_ansible_lint
 
  command: "/usr/sbin/update-ca-certificates --fresh"  # noqa 301
 
  # [301] Commands should not change things if nothing needs doing
 
  #   This task is invoked only if user is very specific about requiring to
 
  #   run the handlers manually as a way to bring the system to consistency
 
  #   after interrupted runs.
 

	
 
- name: Restart ferm
 
  service:
roles/common/tasks/main.yml
Show inline comments
 
@@ -339,11 +339,6 @@
 
      virtualenv_path: "/var/lib/pipreqcheck/virtualenv-py3"
 
      python_path: "/usr/bin/python3"
 
      creates: "/var/lib/pipreqcheck/virtualenv-py3/bin/python3"
 
  tags:
 
    # [ANSIBLE0012] Commands should not change things if nothing needs doing
 
    #   Command will not run if the virtualenv has already been created,
 
    #   therefore the warning is a false positive.
 
    - skip_ansible_lint
 

	
 
- name: Create directory for storing pip requirements files
 
  file:
roles/mail_forwarder/handlers/main.yml
Show inline comments
 
---
 

	
 
- name: Rebuild mail aliases
 
  command: "/usr/bin/newaliases"
 
  tags:
 
    # [ANSIBLE0012] Commands should not change things if nothing needs doing
 
    #   This task is invoked only if user is very specific about requiring to
 
    #   run the handlers manually as a way to bring the system to consistency
 
    #   after interrupted runs.
 
    - skip_ansible_lint
 
  command: "/usr/bin/newaliases"  # noqa 301
 
  # [301] Commands should not change things if nothing needs doing
 
  #   This task is invoked only if user is very specific about requiring to
 
  #   run the handlers manually as a way to bring the system to consistency
 
  #   after interrupted runs.
 

	
 
- name: Restart Postfix
 
  service:
roles/mail_server/handlers/main.yml
Show inline comments
 
@@ -16,10 +16,8 @@
 
    state: restarted
 

	
 
- name: Rebuild mail aliases
 
  command: /usr/bin/newaliases
 
  tags:
 
    # [ANSIBLE0012] Commands should not change things if nothing needs doing
 
    #   This task is invoked only if user is very specific about requiring to
 
    #   run the handlers manually as a way to bring the system to consistency
 
    #   after interrupted runs.
 
    - skip_ansible_lint
 
  command: /usr/bin/newaliases  # noqa 301
 
  # [301] Commands should not change things if nothing needs doing
 
  #   This task is invoked only if user is very specific about requiring to
 
  #   run the handlers manually as a way to bring the system to consistency
 
  #   after interrupted runs.
roles/wsgi_website/tasks/main.yml
Show inline comments
 
@@ -137,11 +137,6 @@
 
    creates: "{{ home }}/virtualenv/bin/{{ python_interpreter | basename }}"
 
  become: true
 
  become_user: "{{ admin }}"
 
  tags:
 
    # [ANSIBLE0012] Commands should not change things if nothing needs doing
 
    #   This task will not fire if the virtual environment has already bene
 
    #   created (thanks to 'creates' parameter).
 
    - skip_ansible_lint
 

	
 
# @TODO: Park of the pkg-resources described above.
 
- name: Install setuptools in virtual environment
0 comments (0 inline, 0 general)