Execution
Date 27 Nov 2024 11:44:09 +0000
Duration 00:02:15.67
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.11
ara 1.7.2 / 1.7.2
Python 3.10.10
Summary
235 Hosts
5 Tasks
927 Results
1 Plays
6 Files
0 Records

File: /home/ssh-gateway/ansible/kuly/check-dns.yaml

---
- name: Check if ttl is zero
  hosts: all
  roles:
    - plesk
  tasks:
    - name: Check via plesk
      when: plesk_found
      ansible.builtin.shell: |
        set -o pipefail
        plesk db -e "select * from dns_recs where ttl=0 and type='NS';"
      args:
        executable: /bin/bash
      changed_when: false
      register: plesk_out
    - name: Save hostname if stdout is not empty
      when: plesk_out.stdout | length > 0
      ansible.builtin.lineinfile:
        path: "/home/ssh-gateway/ansible/check-dns-hosts.txt"
        line: "{{ inventory_hostname }}"
        create: true
        mode: '0644'
      delegate_to: 127.0.0.1