forked from azavea/ansible-scala
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathplaybook.yml
34 lines (26 loc) · 915 Bytes
/
playbook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
- hosts: all
gather_facts: False
become: True
pre_tasks:
# Check Ubuntu release version to determine if we need to install python 2,
# an Ansible dependency that isn't included by default in Ubuntu 16.04 and
# up.
- name: Check Ubuntu release
raw: cat /etc/lsb-release | grep DISTRIB_RELEASE | cut -d "=" -f2
register: ubuntu_release
- debug: msg="Running Ubuntu version {{ ubuntu_release.stdout|float }}"
# Update apt cache and install python 2 for Ubuntu versions greater than
# 16.04
- name: Update APT cache
raw: apt-get update
become: True
- name: Install python
raw: apt-get install -yq python
become: True
when: "{{ ubuntu_release.stdout| version_compare('16.04', '>=') }}"
# Gather facts once ansible dependencies are installed
- name: Gather facts
setup:
roles:
- { role: "ansible-scala" }