Execution
Date 25 Jul 2024 12:13:26 +0100
Duration 00:00:31.39
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
16 Hosts
2 Tasks
20 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/GH_solus-io-cloud-images_25.yaml

---
- name: Playbook to add to PATH on Plesk servers
  hosts: all
  gather_facts: false
  vars:
    ara_playbook_name: GH_solus-io-cloud-images_25.yaml
    ara_playbook_labels:
      - plesk
      - bash
  tasks:
    - name: Run Plesk command and capture output
      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: Ensure PATH is added to .bashrc if Plesk server
      when: "'Plesk' in plsk_out.stdout"
      ansible.builtin.lineinfile:
        path: /root/.bashrc
        line: 'export PATH="$PATH":/opt/ls_tools'
        create: true
        state: present
        backup: true
        mode: '0644'