Execution
Date 20 Aug 2024 12:46:28 +0100
Duration 00:00:28.87
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
99 Hosts
2 Tasks
196 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/which_my_cnf_is_ok_2.yaml

---
- name: Playbook to run big commands
  hosts: all
  gather_facts: false
  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: Run a command
      when: "'Plesk' in plsk_out.stdout"
      ansible.builtin.shell: |
        set -o pipefail
        ps auxww | grep mysql
      args:
        executable: /bin/bash