Execution
Date 19 Aug 2024 13:59:21 +0100
Duration 00:00:01.59
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
1 Files
0 Records

File: /home/ssh-gateway/ansible/which_my_cnf_is_ok.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
        [ -x /usr/local/psa/bin/plesk ] && [ "$(md5sum /etc/my.cnf | awk '{print $1}')" = "7a331d53652222772b8a443231efa3fc" ] && [ "$(md5sum /etc/layershift-default.cnf | awk '{print $1}')" = "418a8d02c0d5350721fb25c7314be208" ] && echo ok || echo NOT_OK
      args:
        executable: /bin/bash
      changed_when: true