Execution
Date 07 Apr 2025 15:35:32 +0100
Duration 00:03:09.32
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
393 Hosts
3 Tasks
1161 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/kuly/RM9972-2.yaml

---
- name: Playbook to check
  hosts: all
  gather_facts: false
  tasks:
    - name: Gather info
      plesk_info:
      register: plsk
    - name: Run command on plesk server
      when: plsk.plesk_found
      ansible.builtin.shell: |
        set -o pipefail
        hostname -f
        sqlite3 /usr/local/psa/var/modules/monitoring/monitoring.sqlite3 "select * from params where name = 'cloud_service_api_key'" | grep 15c642d7e43747cbe4d1f8062d8747e547c111d0aaa3c229e68f1179a61fbcaa
        agent360 --info | grep "Server:" | awk '{ print $2 }'
      args:
        executable: /bin/bash
      register: command_output
      changed_when: false
      failed_when: false
    - name: Check for the specific string and display if not found
      ansible.builtin.debug:
        msg: "{{ command_output.stdout_lines }}"
      when: command_output.stdout.find("15c642d7e43747cbe4d1f8062d8747e547c111d0aaa3c229e68f1179a61fbcaa") == -1