Changeset - a3d247bb2e09
[Not reviewed]
0 10 0
Branko Majic (branko) - 16 days ago 2024-09-03 13:09:27
branko@majic.rs
MAR-218: Update noqa directives for ansible-lint to use text tags:

- Numeric tagging is deprecated.
10 files changed with 28 insertions and 28 deletions:
0 comments (0 inline, 0 general)
roles/backup_client/handlers/main.yml
Show inline comments
 
---
 

	
 
# @TODO: Can't use file module, since one of the files (GnuPG socket)
 
#        seems to disappear in middle of operation).
 
- name: Remove current keyring  # noqa 301
 
  # [301] Commands should not change things if nothing needs doing
 
- name: Remove current keyring  # noqa no-changed-when
 
  # [no-changed-when] 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.
 
  command: "rm -rf /etc/duply/main/gnupg"
 

	
 
- name: Create keyring directory
 
  file:
 
    path: "/etc/duply/main/gnupg"
 
    state: directory
 
    owner: root
 
    group: root
 
    mode: 0700
 

	
 
- name: Import private keys  # noqa 301
 
  # [301] Commands should not change things if nothing needs doing
 
- name: Import private keys  # noqa no-changed-when
 
  # [no-changed-when] 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.
 
  command: "gpg --no-tty --homedir /etc/duply/main/gnupg --import /etc/duply/main/private_keys.asc"
 

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

	
 
- name: Update PAM configuration  # noqa 301
 
  # [301] Commands should not change things if nothing needs doing
 
- name: Update PAM configuration  # noqa no-changed-when
 
  # [no-changed-when] 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.
 
  command: "/usr/sbin/pam-auth-update --package"
 

	
 
- name: Restart SSH
 
  service:
 
    name: ssh
 
    state: restarted
 

	
 
- name: Update CA certificate cache  # noqa 301
 
  # [301] Commands should not change things if nothing needs doing
 
- name: Update CA certificate cache  # noqa no-changed-when
 
  # [no-changed-when] 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.
 
  command: "/usr/sbin/update-ca-certificates --fresh"
 

	
 
- name: Restart ferm
 
  service:
 
    name: ferm
 
    state: restarted
 

	
 
- name: Reload systemd
 
  systemd:
roles/common/tasks/main.yml
Show inline comments
 
@@ -40,26 +40,26 @@
 

	
 
- name: Deploy pam-auth-update configuration file for enabling pam_umask
 
  copy:
 
    src: "pam_umask"
 
    dest: "/usr/share/pam-configs/umask"
 
    owner: root
 
    group: root
 
    mode: 0644
 
  register: pam_umask
 
  notify:
 
    - Update PAM configuration
 

	
 
- name: Update PAM configuration  # noqa 503
 
  # [503] Tasks that run when changed should likely be handlers
 
- name: Update PAM configuration  # noqa no-handler
 
  # [no-handler] Tasks that run when changed should likely be handlers
 
  #   In order to have consistent behaviour during the first and
 
  #   subsequent playbook runs, make sure the PAM configuration is
 
  #   updated immediatelly. This way any files created by commands etc
 
  #   should end-up with correct permissions straight away.
 
  command: "/usr/sbin/pam-auth-update --package"
 
  when: pam_umask.changed
 

	
 
- name: Set login UMASK
 
  lineinfile:
 
    dest: "/etc/login.defs"
 
    state: present
 
    backrefs: true
 
@@ -195,26 +195,26 @@
 
    - Restart SSH
 

	
 
- name: Deploy CA certificates
 
  copy:
 
    content: "{{ item.value }}"
 
    dest: "/usr/local/share/ca-certificates/{{ item.key }}.crt"
 
    owner: root
 
    group: root
 
    mode: 0644
 
  with_dict: "{{ ca_certificates }}"
 
  register: deploy_ca_certificates_result
 

	
 
- name: Update CA certificate cache  # noqa 503
 
  # [503] Tasks that run when changed should likely be handlers
 
- name: Update CA certificate cache  # noqa no-handler
 
  # [no-handler] Tasks that run when changed should likely be handlers
 
  #   CA certificate cache must be updated immediatelly in order for
 
  #   applications depending on deployed CA certificates can use them to
 
  #   validate server/client certificates.
 
  command: "/usr/sbin/update-ca-certificates --fresh"
 
  when: deploy_ca_certificates_result.changed
 

	
 
- name: Set-up file diversions for custom files that overrride package-provided ones
 
  command: "dpkg-divert --divert '{{ item }}.original' --rename '{{ item }}'"
 
  register: "dpkg_divert"
 
  changed_when: "'Adding' in dpkg_divert.stdout"
 
  with_items:
 
    - "/usr/sbin/ferm"
roles/database_server/tasks/main.yml
Show inline comments
 
@@ -14,26 +14,26 @@
 
    state: started
 
    enabled: true
 

	
 
- name: Set UTF-8 encoding as default for MariaDB
 
  template:
 
    src: "utf8.cnf.j2"
 
    dest: "/etc/mysql/mariadb.conf.d/90-utf8.cnf"
 
    owner: root
 
    group: root
 
    mode: 0644
 
  register: mariadb_utf8_configuration
 

	
 
- name: Restart MariaDB in order to use UTF-8 as default character set  # noqa 503
 
  # [503] Tasks that run when changed should likely be handlers
 
- name: Restart MariaDB in order to use UTF-8 as default character set  # noqa no-handler
 
  # [no-handler] Tasks that run when changed should likely be handlers
 
  #   UTF-8 configuration must be applied immediatelly in order to ensure that
 
  #   subsequent tasks that create databases will end-up with correct (UTF-8)
 
  #   encoding. Otherwise they will be created using default latin1.
 
  service:
 
    name: mysql
 
    state: restarted
 
  when: mariadb_utf8_configuration.changed
 

	
 
- name: Explicitly run all handlers
 
  include_tasks: ../handlers/main.yml
 
  when: "run_handlers | default(False) | bool()"
 
  tags:
roles/ldap_server/tasks/main.yml
Show inline comments
 
@@ -17,26 +17,26 @@
 
- name: Install slapd
 
  apt:
 
    name: slapd
 
    state: present
 

	
 
- name: Allow OpenLDAP user to traverse the directory with TLS private keys
 
  user:
 
    name: openldap
 
    append: true
 
    groups: ssl-cert
 
  register: openldap_in_ssl_cert
 

	
 
- name: Restart slapd if group membership has changed (apply immediatelly)  # noqa 503
 
  # [503] Tasks that run when changed should likely be handlers
 
- name: Restart slapd if group membership has changed (apply immediatelly)  # noqa no-handler
 
  # [no-handler] Tasks that run when changed should likely be handlers
 
  #   In order to be able to change LDAP server TLS configuration, it must be
 
  #   able to read both the private key and certificate. Therefore we need to
 
  #   immediatelly restart (since configuration is done live on the server.
 
  service:
 
    name: slapd
 
    state: restarted
 
  when: openldap_in_ssl_cert.changed
 

	
 
- name: Install Python LDAP bindings
 
  apt:
 
    name: python3-pyldap
 
    state: present
roles/mail_forwarder/handlers/main.yml
Show inline comments
 
---
 

	
 
- name: Rebuild mail aliases  # noqa 301
 
  # [301] Commands should not change things if nothing needs doing
 
- name: Rebuild mail aliases  # noqa no-changed-when
 
  # [no-changed-when] 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.
 
  command: "/usr/bin/newaliases"
 

	
 
- name: Restart Postfix
 
  service:
 
    name: postfix
 
    state: restarted
roles/mail_forwarder/tasks/main.yml
Show inline comments
 
@@ -62,37 +62,37 @@
 
    state: present
 
  with_dict: "{{ local_mail_aliases }}"
 
  notify:
 
    - Rebuild mail aliases
 

	
 
- name: Enable and start postfix service
 
  service:
 
    name: postfix
 
    state: started
 
    enabled: true
 

	
 
- name: Retrieve IPv4 addresses of SMTP relay host
 
  shell: "getent ahostsv4 '{{ smtp_relay_host }}' | awk '{ print $1 }' | sort -u"  # noqa 306
 
  # [306] Shells that use pipes should set the pipefail option
 
  shell: "getent ahostsv4 '{{ smtp_relay_host }}' | awk '{ print $1 }' | sort -u"  # noqa risky-shell-pipe
 
  # [risky-shell-pipe] Shells that use pipes should set the pipefail option
 
  #   The getent ahostsv4 command has non-zero exit code if the
 
  #   supplies name cannot be resolved. However, that is a valid
 
  #   use-case for extracting this information. It effectively means
 
  #   that no IPv4 firewall rules will be deployed for allowing
 
  #   incoming connections from the SMTP relay host.
 
  changed_when: false
 
  register: smtp_relay_host_ipv4
 

	
 
- name: Retrieve IPv6 addresses of SMTP relay host
 
  shell: "getent ahostsv6 '{{ smtp_relay_host }}' | awk '{ print $1 }' | grep -v '^::ffff:' | sort -u"  # noqa 306
 
  # [306] Shells that use pipes should set the pipefail option
 
  shell: "getent ahostsv6 '{{ smtp_relay_host }}' | awk '{ print $1 }' | grep -v '^::ffff:' | sort -u"  # noqa risky-shell-pipe
 
  # [risky-shell-pipe] Shells that use pipes should set the pipefail option
 
  #   The getent ahostsv6 command has non-zero exit code if the
 
  #   supplies name cannot be resolved. However, that is a valid
 
  #   use-case for extracting this information. It effectively means
 
  #   that no IPv6 firewall rules will be deployed for allowing
 
  #   incoming connections from the SMTP relay host.
 
  changed_when: false
 
  register: smtp_relay_host_ipv6
 

	
 
- name: Normalise the SMTP relay host IPv4 addresses variable
 
  set_fact:
 
    smtp_relay_host_ipv4: "{{ smtp_relay_host_ipv4.stdout_lines | reject('equalto', '') | list }}"
 
  when: "smtp_relay_host | length != 0"
roles/mail_server/handlers/main.yml
Show inline comments
 
@@ -6,18 +6,18 @@
 
    state: restarted
 

	
 
- name: Restart Dovecot
 
  service:
 
    name: dovecot
 
    state: restarted
 

	
 
- name: Restart ClamAV Milter
 
  service:
 
    name: clamav-milter
 
    state: restarted
 

	
 
- name: Rebuild mail aliases  # noqa 301
 
  # [301] Commands should not change things if nothing needs doing
 
- name: Rebuild mail aliases  # noqa no-changed-when
 
  # [no-changed-when] 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.
 
  command: /usr/bin/newaliases
roles/wsgi_website/tasks/main.yml
Show inline comments
 
@@ -286,26 +286,26 @@
 
    dest: "/etc/nginx/sites-enabled/{{ fqdn }}"
 
    state: link
 
  notify:
 
    - Restart nginx
 

	
 
- name: Set-up empty list of WSGI services to restart
 
  set_fact:
 
    wsgi_services_to_restart: []
 
  when: "wsgi_services_to_restart is not defined"
 
  tags:
 
    - handlers
 

	
 
- name: Add service to list of WSGI services to restart  # noqa 503
 
  # [503] Tasks that run when changed should likely be handlers
 
- name: Add service to list of WSGI services to restart  # noqa no-handler
 
  # [no-handler] Tasks that run when changed should likely be handlers
 
  #   This specific task is used in order to work around inability of Ansible
 
  #   to provide properly parametrised handlers for reusable roles.
 
  set_fact:
 
    wsgi_services_to_restart: "{{ wsgi_services_to_restart + [fqdn] }}"
 
  when: |
 
    fqdn not in wsgi_services_to_restart and
 
    ((install_extra_packages is defined and install_extra_packages.changed) or
 
    (install_additional_packages_in_virtualenv is defined and install_additional_packages_in_virtualenv.changed) or
 
    (deploy_systemd_socket_configuration is defined and deploy_systemd_socket_configuration.changed) or
 
    (deploy_systemd_service_configuration is defined and deploy_systemd_service_configuration.changed) or
 
    (install_gunicorn_via_requirements is defined and install_gunicorn_via_requirements.changed) or
 
    (run_handlers | default(False) | bool()))
roles/xmpp_server/tasks/main.yml
Show inline comments
 
@@ -3,26 +3,26 @@
 
# Main implementation
 
# ===================
 

	
 
- name: Set-up the Debian backports repository
 
  template:
 
    src: backports.list.j2
 
    dest: /etc/apt/sources.list.d/backports.list
 
    owner: root
 
    group: root
 
    mode: 0644
 
  register: backports_repository_configuration
 

	
 
- name: Update apt cache if backports repository configuration changed (for immediate use)  # noqa 503
 
  # [503] Tasks that run when changed should likely be handlers
 
- name: Update apt cache if backports repository configuration changed (for immediate use)  # noqa no-handler
 
  # [no-handler] Tasks that run when changed should likely be handlers
 
  #   Since apt_repository module is not reliable (does not deploy
 
  #   change when changing distro version etc), we have to use
 
  #   template instead, but this also means we need to trigger the apt
 
  #   cache reload by hand.
 
  apt:
 
    update_cache: true
 
  when: backports_repository_configuration.changed
 

	
 
- name: Install additional Prosody dependencies
 
  apt:
 
    name:
 
      - lua-ldap
0 comments (0 inline, 0 general)