Execution
Date 15 May 2025 12:13:20 +0100
Duration 00:04:10.99
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
340 Hosts
6 Tasks
2030 Results
1 Plays
1 Files
0 Records

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

---
- name: Playbook for RM10046 tests
  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: RM10046-script.sh
            dest: /tmp/RM10046-script.sh
            mode: '0755'
          changed_when: false
        - name: Execute the script
          ansible.builtin.shell: /tmp/RM10046-script.sh
          register: whois_result
          ignore_errors: true
          changed_when: whois_result.stdout == 'BAD'
        - name: Save to list
          when: whois_result.stdout == 'BAD'
          ansible.builtin.lineinfile:
            path: /home/ssh-gateway/ansible/kuly/RM10046-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.shell: rm -f /tmp/RM10046-script.sh
          ignore_errors: true
          changed_when: false