Execution
Date 10 Sep 2024 13:12:46 +0100
Duration 00:00:07.90
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
10 Hosts
4 Tasks
31 Results
1 Plays
6 Files
0 Records

File: /home/ssh-gateway/ansible/kuly/update_provider_metrics.yaml

---
- name: Playbook to upgrade provider_metrics
  hosts: all
  gather_facts: false
  roles:
    - plesk
  tasks:
    - name: Get the hostname line
      when: plesk_found
      block:
        - name: Match the pattern
          ansible.builtin.shell: |
            set -o pipefail
            grep "host=" /etc/agent360-custom.ini
          args:
            executable: /bin/bash
          register: host_out
          changed_when: false

        - name: Replace the line that matches 'host=' with an empty line
          when: "'host=' in host_out.stdout"
          ansible.builtin.replace:
            path: /etc/agent360-custom.ini
            regexp: '^host=.*'
            replace: ''