Execution
Date 11 Sep 2024 15:44:44 +0100
Duration None
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
0 Hosts
1 Tasks
0 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