Execution
Date 04 Dec 2025 13:30:06 +0000
Duration 00:00:08.71
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.11
ara 1.7.3 / 1.7.3
Python 3.10.10
Summary
1 Hosts
5 Tasks
5 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/kuly/RM10220-botstopper-toggler.yaml

---
- name: Toggle botstopper
  hosts: all
  gather_facts: false
  tasks:
    - name: Get server info
      plesk_info:
      register: plsk
    - name: Run toggler on plesks
      when:
        - plsk.plesk_found
        - "'running' in plsk.botstopper_status"
      block:
        - name: Check botstopper
          ansible.builtin.command: grep -i '^botstopperEnabled' /usr/local/psa/admin/conf/panel.ini
          register: botstopper_raw
          changed_when: false
        - name: Extract value
          ansible.builtin.set_fact:
            botstopper_enabled: "{{ botstopper_raw.stdout.split('=')[1] | trim }}"
        - name: Print it
          ansible.builtin.debug:
            var: botstopper_enabled
        - name: Do something
          when: botstopper_enabled == false
          ansible.builtin.shell: |
            set -o pipefail
            curl -Ls https://deploy.thecode.casa/agent360_plugins/toggler.sh | bash -s botstopper disable && plesk ext ls-botstopper --disable-all -yes && plesk ext ls-botstopper --service-disable-all -yes
          args:
            executable: /bin/bash
          changed_when: false