Execution
Date 06 Sep 2024 12:09:06 +0100
Duration 00:00:01.35
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
1 Hosts
2 Tasks
2 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 info
  ansible.builtin.shell: |
    if [ -x /sbin/plesk ]; then
      /sbin/plesk -v | grep "Product version" | cut -d ":" -f2 | sed "s/^[ \t]*//" | awk '{print $NF}'
    else
      echo "Plesk not found"
    fi
  args:
    executable: /bin/bash
  register: plsk_out
  changed_when: false

- name: Set facts based on Plesk existence and version
  ansible.builtin.set_fact:
    plesk_found: "{{ plsk_out.stdout != 'Plesk not found' }}"
    plesk_version: "{{ plsk_out.stdout if plesk_found else 'N/A' }}"