-
Notifications
You must be signed in to change notification settings - Fork 0
/
playbook.yml
84 lines (83 loc) · 3.87 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
---
- hosts: master
remote_user: vagrant
become: yes
become_method: sudo
tasks:
- name: update hosts file
template: src=./hosts.j2 dest=/etc/hosts
- name: install ruby
yum: pkg=ruby state=latest
- name: install mesosphere yum repo
yum: name=http://repos.mesosphere.com/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm state=present
- name: install zookeeper yum repo
yum: name=http://archive.cloudera.com/cdh4/one-click-install/redhat/6/x86_64/cloudera-cdh-4-0.x86_64.rpm state=present
- name: install zookeeper
yum: pkg=zookeeper,zookeeper-server state=latest
- name: configure zookeeper ID
become_user: zookeeper
shell: zookeeper-server-initialize --myid=1
- name: install mesos, marathon, chronos, and docker packages
yum: pkg=device-mapper-event-libs,mesos,marathon,chronos,docker state=latest
- name: configure containerizers
lineinfile: dest=/etc/mesos-slave/containerizers create=yes line="docker,mesos"
- name: start zookeeper
service: name=zookeeper-server state=started enabled=yes
- name: start mesos-master
service: name=mesos-master state=started enabled=yes
- name: start mesos-slave
service: name=mesos-slave state=started enabled=yes
- name: start marathon
service: name=marathon state=started enabled=yes
- name: start chronos
service: name=chronos state=started enabled=yes
- name: start docker
service: name=docker state=started enabled=yes
- name: install outyet
shell: docker pull wumuxian/outyet
- name: install go, git, and dnsutil packages
yum: pkg=golang,git,bind-utils state=latest
- name: build/configure mesos-dns
become_user: vagrant
shell: sh /vagrant/installdns.sh
- name: configure dns
template: src=./resolv.conf.j2 dest=/etc/resolv.conf
- name: config network interface ifcfg-lo to stop resolv.conf to be overwritten
lineinfile: dest=/etc/sysconfig/network-scripts/ifcfg-lo line="NM_CONTROLLED=no\nPEERDNS=no"
- name: config network interface ifcfg-enp0s3 to stop resolv.conf to be overwritten
lineinfile: dest=/etc/sysconfig/network-scripts/ifcfg-enp0s3 line="NM_CONTROLLED=no\nPEERDNS=no"
- name: configure marathon services
shell: cd /vagrant/marathon && sh post.sh
- name: sync chronos jobs
shell: ruby /vagrant/chronos-sync.rb -u http://192.168.33.10:4400/ -p /vagrant/chronos
- name: update the rsyslog config
template: src=./mesos.conf.j2 dest=/etc/rsyslog.d/mesos.conf
- name: restart rsyslog
shell: service rsyslog restart
- hosts: nodes
remote_user: vagrant
become: yes
become_method: sudo
tasks:
- name: update hosts file
template: src=./hosts.j2 dest=/etc/hosts
- name: install mesosphere yum repo
yum: name=http://repos.mesosphere.com/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm state=present
- name: install mesos and docker packages
yum: pkg=device-mapper-event-libs,mesos,docker state=latest
- name: configure containerizers
lineinfile: dest=/etc/mesos-slave/containerizers create=yes line="docker,mesos"
- name: set zookeeper master
replace: dest=/etc/mesos/zk regexp="localhost" replace="192.168.33.10"
- name: stop the mesos slave but make it start on book
service: name=mesos-slave state=started enabled=yes
- name: disable the mesos-master by default
service: name=mesos-master state=stopped enabled=no
- name: start docker
service: name=docker state=started enabled=yes
- name: install outyet
shell: docker pull wumuxian/outyet
- name: update the rsyslog config
template: src=./mesos.conf.j2 dest=/etc/rsyslog.d/mesos.conf
- name: restart rsyslog
shell: service rsyslog restart