--- - name: Check Y2K38 readiness on Raspberry Pis hosts: "{{ target }}" gather_facts: yes tasks: - name: "Setze mind. Kernelversion" ansible.builtin.set_fact: current_version: 5.6 - name: Check architecture command: uname -m register: arch_check changed_when: false - name: Ensure architecture is aarch64 fail: msg: "System is not aarch64. Y2K38 safety cannot be guaranteed." when: arch_check.stdout != "aarch64" - name: Check kernel version command: uname -r register: kernel_check changed_when: false - debug: var: kernel_check - name: Ensure kernel version is >= 5.6 fail: msg: "Kernel version is less than 5.6. Update the kernel to ensure Y2K38 safety." when: current_version is version(latest_version, '>') when: (kernel_check.stdout | regex_search('^(\d+)\.(\d+)', '\\1.\\2') | float) < 5.6 - name: Check glibc version command: ldd --version register: glibc_check changed_when: false - name: Ensure glibc version is >= 2.28 fail: msg: "glibc version is less than 2.28. Update glibc to ensure Y2K38 safety." when: > glibc_check.stdout_lines[0] is search(".*(\d+)\.(\d+).*") and ((glibc_check.stdout_lines[0] | regex_replace('.*(\d+)\.(\d+).*', '\\1.\\2') | float) < 2.28) - name: Test future timestamp with date command: date -d @2147483648 register: date_check changed_when: false - name: Ensure future timestamp works correctly fail: msg: "Date command failed to handle timestamps beyond 2038. Y2K38 safety is not guaranteed." when: "'2038-01-19' not in date_check.stdout" - name: Ensure system is up-to-date apt: update_cache: yes upgrade: dist