Execution
Date 01 Apr 2026 12:12:57 +0100
Duration 00:00:04.31
Controller ssh-gw-4.layershift.com
User root
Versions
Ansible 2.16.13
ara 1.7.5 / 1.7.5
Python 3.10.10
Summary
1 Hosts
3 Tasks
3 Results
1 Plays
1 Files
0 Records

File: /home/ssh-gateway/ansible/kuly/RM10221-check-alma-servers.yaml

---
- name: RM10221 check alma
  hosts: all
  gather_facts: false
  tasks:
    - name: Get server info
      plesk_info:
      register: p
    - name: Read OS release information
      when: p.os_distribution == "AlmaLinux"
      ansible.builtin.slurp:
        src: /etc/os-release
      register: os_release_content
    - name: Parse OS version
      when:
        - p.os_distribution == "AlmaLinux"
        - os_release_content.content is defined
      ansible.builtin.set_fact:
        alma_version: "{{ (os_release_content.content | b64decode | regex_search('VERSION_ID=\"([0-9]+)\"', '\\1') | first) | int }}"
    - name: Check if AlmaLinux 8 and fix grubenv
      when:
        - p.os_distribution == "AlmaLinux"
        - alma_version is defined
        - alma_version == 8
      block:
        - name: Check if grubenv exists
          ansible.builtin.stat:
            path: /boot/efi/EFI/almalinux/grubenv
          register: grubenv_file
        - name: Run fix commands when grubenv is missing
          when: not grubenv_file.stat.exists
          ansible.builtin.debug:
            msg: "grubenv file missing on {{ inventory_hostname }} (AlmaLinux {{ alma_version }}) - running fixes..."