-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
131 lines (119 loc) · 3.67 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
---
- hosts: default
roles:
- codeyourinfra.docker_compose
- codeyourinfra.maven
tasks:
- name: Install required packages
apt:
name: "{{ item }}"
update_cache: yes
loop:
- language-pack-pt
- mysql-client
- firefox
- python3-pip
- python-dev
- libldap2-dev
- libsasl2-dev
- libssl-dev
- ldap-utils
- name: Install required python packages
pip:
name: "{{ item }}"
loop:
- docker
- docker-compose
- python-ldap
- name: Install Apache Spark 2.4.3
block:
- name: Create Spark dir
file:
path: /opt/spark
state: directory
- name: Download and unarchive Spark
unarchive:
src: http://mirrors.up.pt/pub/apache/spark/spark-2.4.3/spark-2.4.3-bin-hadoop2.7.tgz
dest: /opt/spark
remote_src: yes
extra_opts:
- --strip-components=1
owner: root
group: root
- name: Disable Ubuntu unattended-upgrades during startup, to enable apt-get provisioning.
ini_file:
path: /lib/systemd/system/apt-daily.timer
section: Timer
option: Persistent
value: false
- name: Replace timesyncd with NTP
include_tasks: timesync.yml
- name: Get Ubuntu version
shell: lsb_release -ds
register: ubuntu_version_result
- name: Show Ubuntu version
debug:
msg: "{{ ubuntu_version_result.stdout_lines[0] }}"
- name: Store Ubuntu version
copy:
dest: ubuntu-version.txt
content: "{{ ubuntu_version_result.stdout_lines[0] }}"
delegate_to: localhost
- name: Get Docker version
shell: docker -v
register: docker_version_result
- name: Set Docker version fact
set_fact:
docker_version: "{{ docker_version_result.stdout_lines[0] | regex_search('([\\d.]+)') }}"
- name: Show Docker version
debug:
msg: "{{ docker_version }}"
- name: Store Docker version
copy:
dest: docker-version.txt
content: "{{ docker_version }}"
delegate_to: localhost
- name: Get Docker Compose version
shell: docker-compose -v
register: docker_compose_version_result
- name: Set Docker Compose version fact
set_fact:
docker_compose_version: "{{ docker_compose_version_result.stdout_lines[0] | regex_search('([\\d.]+)') }}"
- name: Show Docker Compose version
debug:
msg: "{{ docker_compose_version }}"
- name: Store Docker Compose version
copy:
dest: docker-compose-version.txt
content: "{{ docker_compose_version }}"
delegate_to: localhost
- name: Get Java version
shell: java -version
register: java_version_result
- name: Set Java version fact
set_fact:
java_version: "{{ java_version_result.stderr_lines[0] | regex_search('([\\d.]+_\\d*)') }}"
- name: Show Java version
debug:
msg: "{{ java_version }}"
- name: Store java version
copy:
dest: java-version.txt
content: "{{ java_version }}"
delegate_to: localhost
- name: Get Maven version
shell: mvn -version
register: maven_version_result
- name: Set Maven version fact
set_fact:
maven_version: "{{ maven_version_result.stdout_lines[0] | regex_search('([\\d.]+)') }}"
- name: Show Maven version
debug:
msg: "{{ maven_version }}"
- name: Store Maven version
copy:
dest: maven-version.txt
content: "{{ maven_version }}"
delegate_to: localhost
- name: Minimize disk space
script: minimize.sh