diff --git a/roles/ubuntu-bootstrap/defaults/main.yml b/roles/ubuntu-bootstrap/defaults/main.yml new file mode 100644 index 000000000..0de237cfa --- /dev/null +++ b/roles/ubuntu-bootstrap/defaults/main.yml @@ -0,0 +1,2 @@ +--- +bootstrap_versions: Ubuntu 1[6-9]\|2[0-9]\. \ No newline at end of file diff --git a/roles/ubuntu-bootstrap/tasks/main.yml b/roles/ubuntu-bootstrap/tasks/main.yml new file mode 100644 index 000000000..317243773 --- /dev/null +++ b/roles/ubuntu-bootstrap/tasks/main.yml @@ -0,0 +1,14 @@ +--- +# raw: cat /etc/issue.net | grep '{{ bootstrap_versions }}' + +- name: Bootstrap | Check if bootstrap is needed + raw: which python + register: need_bootstrap + ignore_errors: True + +- name: Bootstrap | Install python 2.x + raw: DEBIAN_FRONTEND=noninteractive apt install -y python-minimal + when: need_bootstrap | failed + +- set_fact: + ansible_python_interpreter: "/usr/bin/python" \ No newline at end of file diff --git a/ubuntu-bootstrap.yml b/ubuntu-bootstrap.yml new file mode 100644 index 000000000..b6adf783d --- /dev/null +++ b/ubuntu-bootstrap.yml @@ -0,0 +1,5 @@ +--- +- hosts: all + gather_facts: False + roles: + - ubuntu-bootstrap