-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathspark-playbook.yml
112 lines (111 loc) · 4.05 KB
/
spark-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
---
- hosts: spark
remote_user: '{{ remote_user }}'
vars:
cran_url: http://cran-mirror.cs.uu.nl
cran_ppa_key: E084DAB9
tasks:
- name: Only allow incoming traffic from trusted networks
ufw: rule=allow src={{ item }} state=enabled
with_items: "{{ trusted_networks }}"
- name: Set hostname to fqdn
hostname: name='{{ inventory_hostname }}'
- name: Dont bind hostname to loopback
replace: dest=/etc/hosts regexp='^127.0.1.1 .*$' replace='' backup=yes
- name: Set locale
blockinfile:
dest: /etc/environment
block: |
LC_ALL="en_US.utf-8"
- name: Swap file
script: swap.sh creates=/swapfile
- name: Remove puppet and chef
apt: name={{ item }} state=absent
with_items:
- puppet
- chef
- name: Check if packages need to be autoremoved
command: apt-get --dry-run autoremove
register: check_autoremove
changed_when: False
- name: Autoremove unused packages
command: apt-get -y autoremove
when: "'packages will be REMOVED' in check_autoremove.stdout"
- name: Add ppa:webupd8team/java
apt_repository: repo=ppa:webupd8team/java
- name: R ppa key
apt_key: id="{{ cran_ppa_key }}" state=present keyserver=keyserver.ubuntu.com
- name: R ppa
apt_repository: repo='deb {{ cran_url }}/bin/linux/ubuntu trusty/' state=present
- name: Docker repo key
apt_key: keyserver=hkp://p80.pool.sks-keyservers.net:80 id=58118E89F3A912897C070ADBF76221572C52609D
- name: Docker repo
apt_repository: repo='deb https://apt.dockerproject.org/repo ubuntu-trusty main'
- name: Update apt cache
apt: update_cache=yes
- name: Install reboot notifier
apt: name=update-notifier-common
- name: Upgrade APT to the lastest packages
apt: upgrade=full
- name: Rebooting machine so new kernel is active
command: shutdown -r now removes=/var/run/reboot-required
async: 0
poll: 0
ignore_errors: true
register: restarted
- name: Waiting for reboot...
local_action: wait_for host={{ ansible_ssh_host | default(inventory_hostname) }} search_regex=OpenSSH port=22 delay=15 state=started
sudo: no
when: restarted.changed
- name: Rebooting machine so new kernel is active
command: shutdown -r now removes=/var/run/reboot-required
async: 0
poll: 0
ignore_errors: true
register: restarted
- name: Waiting for reboot...
local_action: wait_for host={{ ansible_ssh_host | default(inventory_hostname) }} search_regex=OpenSSH port=22 delay=15 state=started
sudo: no
when: restarted.changed
- name: accept Oracle license
debconf: name='oracle-java8-installer' question='shared/accepted-oracle-license-v1-1' vtype='select' value='true'
- name: Oracle JDK8
apt: name={{ item }}
with_items:
- oracle-java8-installer
- oracle-java8-set-default
- oracle-java8-unlimited-jce-policy
- name: NTP
apt: name=ntp
- name: numpy
apt: name=python-numpy
- name: libnet
apt: name=libnetlib-java
- name: R
apt: name=r-recommended
- name: R javareconf
command: R CMD javareconf
- name: RJava
apt: name=r-cran-rjava
- name: Docker
apt: name=docker-engine
- hosts: frontend
remote_user: '{{ remote_user }}'
vars:
ambari_repo: http://public-repo-1.hortonworks.com/ambari/ubuntu14/2.x/updates/2.2.2.0/ambari.list
tasks:
- name: Ambari repo
get_url: url={{ ambari_repo}} dest=/etc/apt/sources.list.d/ambari.list
- name: Ambari repo key
apt_key: keyserver=keyserver.ubuntu.com id=B9733A7A07513CAD
- name: Update apt cache
apt: update_cache=yes
- name: Ambari server install
apt: name=ambari-server
- name: Ambari server setup
command: ambari-server setup -s -j /usr/lib/jvm/java-8-oracle creates=/etc/ambari-server/conf/password.dat
- name: Ambari server start
service: name=ambari-server state=started
# TODO
# * Use ambari blueprint
# * Add forqlift, http://qethanm.cc/projects/forqlift/