Execution
Date 20 Aug 2024 15:51:28 +0100
Duration 00:00:01.27
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
1 Tasks
1 Results
1 Plays
6 Files
0 Records

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

---
# tasks file for plesk

- name: Run Plesk command and capture full version text
  ansible.builtin.shell: |
    set -o pipefail
    /sbin/plesk -v | grep "Product version" | cut -d ":" -f2
  args:
    executable: /bin/bash
  register: plsk_out
  changed_when: false

- name: Run Plesk command and capture numeric version only
  ansible.builtin.shell: |
    set -o pipefail
    /sbin/plesk -v | grep "Product version" | cut -d ":" -f2 | sed "s/^[ \t]*//" | awk '{print $NF}'
  args:
    executable: /bin/bash
  register: plsk_ver
  when: "'Plesk' in plsk_out.stdout"
  changed_when: false