Execution
Date 10 Sep 2025 14:13:24 +0100
Duration 00:00:29.13
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.11
ara 1.7.3 / 1.7.3
Python 3.10.10
Summary
44 Hosts
6 Tasks
228 Results
1 Plays
1 Files
0 Records

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

---
- name: Playbook to check provider metrics health
  hosts: all
  gather_facts: false
  tasks:
    - name: Gather info
      plesk_info:
      register: plsk
    - name: Run commands on plesk servers
      when: plsk.plesk_found
      block:
        - name: Upload the script
          ansible.builtin.copy:
            src: RM10128-bash-script.sh
            dest: /tmp/RM10128-bash-script.sh
            mode: '0755'
          changed_when: false
        - name: Execute the script
          ansible.builtin.command: /tmp/RM10128-bash-script.sh
          register: whois_result
          ignore_errors: true
          changed_when: "'JSON structure mismatch' in whois_result.stdout"
        - name: Save to list
          when: "'JSON structure mismatch' in whois_result.stdout"
          ansible.builtin.lineinfile:
            path: /home/ssh-gateway/ansible/kuly/RM10128-bad-hosts.txt
            create: true
            mode: '0644'
            line: '{{ inventory_hostname }}'
          delegate_to: localhost
          changed_when: false
        - name: Show script result
          ansible.builtin.debug:
            msg: "Result: {{ whois_result.stdout }}"
        - name: Remove the script
          ansible.builtin.command: rm -f /tmp/RM10128-bash-script.sh
          changed_when: false
          failed_when: false