--- # Проверка версии ОС - name: Check OS version block: - name: "Get the OS facts" gather_facts: - name: OS info debug: msg: - "OS: {{ ansible_distribution }}" - "Version: {{ ansible_distribution_version }}" - "Major version: {{ ansible_distribution_major_version }}" - name: OS version not supported fail: msg: "Operating system {{ ansible_distribution }} ver. {{ ansible_distribution_major_version }} not supported" when: ansible_distribution not in ['Ubuntu']