Execution
Date 12 Feb 2026 13:43:00 +0000
Duration 00:04:38.56
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.11
ara 1.7.4 / 1.7.4
Python 3.10.10
Summary
394 Hosts
5 Tasks
1952 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/kuly/RM10294.yaml

---
- name: Check watchdog for amavis entries
  hosts: all
  gather_facts: false
  tasks:
    - name: Get server info
      plesk_info:
      register: plsk
    - name: Execute checks when plesk PES found
      when:
        - plsk.plesk_found
        - "'email-security' in (plsk.plesk_extensions | map(attribute='id') | list)"
      block:
        - name: Run query
          ansible.builtin.shell: |
            set -o pipefail
            /usr/bin/sqlite3 /usr/local/psa/var/modules/watchdog/watchdog.sqlite3 "select * from module_watchdog_service where name='amavisd'"
          args:
            executable: /bin/bash
          changed_when: false
          register: query_res
        - name: Check template
          ansible.builtin.stat:
            path: /usr/local/psa/var/modules/watchdog/etc/service.tpl.d/amavisd
          register: amavisd_template
          changed_when: false
        - name: Check if amavisd is active
          ansible.builtin.stat:
            path: /usr/local/psa/var/modules/watchdog/etc/service.d/amavisd
          register: amavisd_active
          changed_when: false
        - name: Report amavisd watchdog problems
          ansible.builtin.debug:
            msg: |
              Amavisd watchdog configuration problems detected:
              - DB entry: {{ 'MISSING' if query_res.stdout | length == 0 else 'OK' }}
              - Template file: {{ 'MISSING' if not amavisd_template.stat.exists else 'OK' }}
              - Active service file: {{ 'MISSING' if not amavisd_active.stat.exists else 'OK' }}
          when: >
            query_res.stdout | length == 0 or
            not amavisd_template.stat.exists or
            not amavisd_active.stat.exists
          changed_when: true