Execution
Date 26 Aug 2024 09:43:07 +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/install_tuxcare_ext.yaml

---
- name: Playbook to install tuxcare-els extension for centos
  hosts: all
  gather_facts: false
  roles:
    - plesk
  tasks:
    - name: Install plesk extension and check
      when: "'Plesk' in plsk_out.stdout"
      block:
        - name: Install plesk ext
          ansible.builtin.shell: |
            set -o pipefail
            plesk bin extension --install tuxcare-els
          args:
            executable: /bin/bash
          changed_when: false

        - name: Check if installed
          ansible.builtin.shell: |
            set -o pipefail
            plesk bin extension --list | grep tuxcare-els
          args:
            executable: /bin/bash
          changed_when: false
          register: tux_out
          failed_when: tux_out.rc != 0

        - name: Do smth if tuxcare is or is not installed
          when: tux_out is defined and 'tuxcare-els' in tux_out.stdout
          ansible.builtin.debug:
            msg: "Tuxcare ELS is installed"

        - name: Tuxcare is not installed
          when: tux_out is defined and 'tuxcare-els' not in tux_out.stdout
          ansible.builtin.debug:
            msg: "Tuxcare ELS is NOT installed"