Execution
Date 19 Feb 2026 14:34:01 +0000
Duration 00:00:03.42
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.13
ara 1.7.4 / 1.7.4
Python 3.10.10
Summary
0 Hosts
1 Tasks
0 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,redis_version\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 }},{{ redis_version }}"
        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' }}

        container_count: "{{ plesk_data.redis_containers | length }}"

        redis_version: "{{ plesk_data.redis_version | default('N/A') }}"

        redis_save: "{{ plesk_data.redis_found or (plesk_data.redis_containers | length > 0) }}"