Execution
Date 16 Dec 2025 14:39:23 +0000
Duration 00:00:04.65
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
4 Tasks
4 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 and export CSV
  hosts: all
  gather_facts: false
  vars:
    csv_file: "redis_report.csv"
  tasks:
    - name: Gather Plesk and Redis information
      plesk_info:
      register: plesk_data
    - name: Determine Redis type
      ansible.builtin.set_fact:
        redis_type: >-
          {% if plesk_data.redis_found %}
            standalone
          {% elif plesk_data.redis_containers | length > 0 %}
            docker
          {% else %}
            none
          {% endif %}
    - name: Create CSV with headers if not exists
      delegate_to: localhost
      run_once: true
      ansible.builtin.copy:
        dest: "{{ csv_file }}"
        content: "hostname,redis_found,redis_type,redis_containers\n"
        force: false
        mode: '0644'
    - name: Append Redis info row to CSV
      delegate_to: localhost
      ansible.builtin.lineinfile:
        path: "{{ csv_file }}"
        line: "{{ inventory_hostname }},{{ plesk_data.redis_found }},{{ redis_type }},{{ plesk_data.redis_containers | length }}"
        insertafter: EOF
        create: false