Ошибка при выполнении плейбука на хосте, где нет python


bash-4.4$ ansible-playbook -i ./hosts.yml ubuntu-pre.yml

PLAY [Подготовка свежей Ubuntu] ******************************************************************************************

TASK [Установка python] **************************************************************************************************
fatal: [test]: FAILED! => {"changed": false, "module_stderr": "Shared connection to 192.168.0.10 closed.\r\n", "module_s
tdout": "bash: warning: setlocale: LC_ALL: cannot change locale (ru_RU.utf8)\r\n/bin/sh: 1: /usr/bin/python: not found\r\n
", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 127}                                              
       to retry, use: --limit @/home/user/devops/ansible/ubuntu-pre.retry

PLAY RECAP ***************************************************************************************************************
test                       : ok=0    changed=0    unreachable=0    failed=1   
Ответы

Решение:

---
- name: 'Подготовка свежей Ubuntu'
  hosts: test
  remote_user: root
  gather_facts: no

  tasks:
  - name: Установка python
    raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)