--- - name: Prepare hosts: all gather_facts: false tasks: - name: Install python for Ansible raw: test -e /usr/bin/python || (dnf -y install python3 && alternatives --set python /usr/bin/python3) become: true changed_when: false