Execution
Date 17 Dec 2025 08:41:02 +0000
Duration 00:00:02.77
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
2 Hosts
3 Tasks
3 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/kuly/zz-vik-447-redis.yaml

---
- name: Check Plesk servers for Redis installations
  hosts: all
  gather_facts: false
  vars:
    csv_path: "redis_report.csv"

  tasks:
    - name: Gather Plesk and Redis information
      plesk_info:
      register: plesk_data

    - name: Ensure CSV exists with header (run once)
      ansible.builtin.copy:
        dest: "{{ csv_path }}"
        content: "hostname,redis_type,redis_containers\n"
        mode: "0644"
        force: false
      delegate_to: localhost
      run_once: true

    - name: Append Redis info to CSV
      ansible.builtin.lineinfile:
        path: "{{ csv_path }}"
        line: "{{ inventory_hostname }},{{ redis_type }},{{ container_count }}"
        insertafter: EOF
      delegate_to: localhost
      when: redis_save | bool
      vars:
        redis_type: >-
          {{ ('both' if (plesk_data.redis_found and (plesk_data.redis_containers | length > 0))
              else 'standalone' if plesk_data.redis_found
              else 'docker' if (plesk_data.redis_containers | length > 0)
              else 'none') | trim }}
        container_count: "{{ plesk_data.redis_containers | length }}"
        redis_save: "{{ plesk_data.redis_found or (plesk_data.redis_containers | length > 0) }}"