Execution
Date 04 Jun 2024 13:26:28 +0100
Duration 00:01:09.10
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.4
ara 1.7.1 / 1.7.1
Python 3.10.10
Summary
81 Hosts
5 Tasks
353 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/RM9591.yaml

---
- name: Playbook to update plugins on servers that has monitoring360
  hosts: all
  gather_facts: false
  vars:
    ara_playbook_name: RM9591.yaml
    ara_playbook_labels:
      - plesk
      - monitoring360
      - update
  tasks:
    - name: Run agent360 --info command
      ansible.builtin.command: agent360 --info
      register: agent360_info
      changed_when: false

    - name: Check if plugins are enabled
      ansible.builtin.set_fact:
        plugins_enabled: "{{ 'Plugins enabled' in agent360_info.stdout }}"

    - name: Check if server ID is present
      ansible.builtin.set_fact:
        server_id_present: "{{ 'Server:' in agent360_info.stdout }}"
      changed_when: false

    - name: Run a command if plugins and server ID are present
      ansible.builtin.command: echo "Both plugins and server ID are present"
      when: plugins_enabled and server_id_present
      changed_when: false

    - name: Debug output for verification
      ansible.builtin.debug:
        msg: "Plugins enabled: {{ plugins_enabled }}, Server ID present: {{ server_id_present }}"