diff --git a/roles/ubuntu-bootstrap/defaults/main.yml b/roles/ubuntu-bootstrap/defaults/main.yml new file mode 100644 index 0000000000000000000000000000000000000000..0de237cfaa1beeea1b17a8d40b9bbab4c7db6bb0 --- /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 0000000000000000000000000000000000000000..317243773b4c9c60aeb646d87649a2c0615591b7 --- /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 0000000000000000000000000000000000000000..b6adf783d2ff1cd181c0a4ca8079aacf0f767913 --- /dev/null +++ b/ubuntu-bootstrap.yml @@ -0,0 +1,5 @@ +--- +- hosts: all + gather_facts: False + roles: + - ubuntu-bootstrap