Execution
Date 14 May 2025 10:42:36 +0100
Duration 00:00:02.60
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
1 Hosts
3 Tasks
3 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
      ansible.builtin.shell: |
        set -o pipefail
        IP=$(hostname -I| awk '{print $1}')
        echo $IP
        ((whois ns1.$(hostname) ; whois ns2.$(hostname)) | grep  -q $IP ) && ((whois ns1.$(hostname) ; whois ns2.$(hostname)) | grep  -q "Server Name" ) && echo OK || echo BAD
      args:
        executable: /bin/bash
      changed_when: cmd_out.stdout == 'BAD'
      register: cmd_out
    - name: Show the result
      ansible.builtin.debug:
        var: cmd_out