2 ms·
With Ansible I use the 'raw' command to run a command to check whether Python (dependency of Ansible) is installed, and install it if not. - name: Bootstra
by fredsted 9y ago
With Ansible I use the 'raw' command to run a command to check whether Python (dependency of Ansible) is installed, and install it if not.
- name: Bootstrap Ansible
hosts: all
gather_facts: False
tasks:
- name: Install Python 2
raw: test -e /usr/bin/python || (sudo apt -y update && sudo apt install -y python-minimal)