Execution
Date 27 Nov 2024 10:59:19 +0000
Duration 00:01:50.31
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
234 Hosts
4 Tasks
696 Results
1 Plays
6 Files
0 Records

File: /home/ssh-gateway/ansible/roles/plesk/tasks/main.yml

---
# tasks file for plesk

- name: Check if Plesk binary exists and capture version information
  ansible.builtin.shell: |
    set -o pipefail
    if [ -x /sbin/plesk ]; then
      /sbin/plesk -v | grep "Product version" | cut -d ":" -f2 | sed "s/^[ \t]*//" | awk '{print $NF}'
    fi
  args:
    executable: /bin/bash
  register: plesk_output
  changed_when: false

- name: Set Plesk facts
  ansible.builtin.set_fact:
    plesk_found: "{{ plesk_output.stdout is not none and plesk_output.stdout != '' }}"
    plesk_version: "{{ plesk_output.stdout if plesk_output.stdout is not none else 'unknown' }}"
  when: plesk_output.stdout is not none