--- # This playbook ensures Python 2 is installed on the managed node. # This is inspired by https://gist.github.com/gwillem/4ba393dceb55e5ae276a87300f6b8e6f - hosts: all gather_facts: false remote_user: ubuntu pre_tasks: - name: Install Python 2 raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal) become: true # action: setup will gather facts after python2 has been installed - action: setup