-
Notifications
You must be signed in to change notification settings - Fork 0
/
local.yml
111 lines (89 loc) · 3.59 KB
/
local.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
---
- hosts: localhost
connection: local
sudo: yes
vars:
- myvars: hostvars['{{ ansible_fqdn }}']
tasks:
- name: Package install
apt: name={{ item }} state=present update_cache=yes
with_items:
- apt-transport-https
- monit
- openvswitch-switch
- bridge-utils
- python-setuptools
# Had problems with python-pip package
- name: install pip
easy_install: name=pip
# Requirement to use Ansible
- name: install docker-py
pip: name=docker-py state=latest
- name: Create br-tun
openvswitch_bridge: bridge=br-tun state=present
- name: Docker repository
copy: src=files/docker.list
dest=/etc/apt/sources.list.d/docker.list
- name: Import the repository key
apt_key: keyserver=keyserver.ubuntu.com id=36A1D7869245C8950F966E92D8576A8BA88D21E9
- name: Set up extra disk for Docker
shell: /usr/testbed/bin/mkextrafs /mnt
creates=/mnt/local
- name: Docker install
apt: name=lxc-docker state=present update_cache=yes
notify: post Docker install
- name: Docker config file
template: src=templates/docker
dest=/etc/default/docker
- name: add GEE user
user: name=gee shell=/bin/bash groups=docker,root append=yes
- name: add public keys
authorized_key:
user=gee
key="{{ item }}"
with_items:
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDs5KFS/ZoOVevr7aa8PdhrSFjCS2eCak2Ze1O8PpvLD9vH8np0sfzpzZBTTRw2RGrfaoOQg/RjVdAhVfa9OAncepnj6awWCUIdks0xmb19PZBEq/Y0TW/rpWfFsQLKJkHjtEfPMhcyYW3DoyP5NkXxOYPPQsRGQawFa5K0BdaMLSZpTJxNqIvU4yutfo9UeaT/9rGvYOreChXf/hXk8bKr9NRERCr8RCglw009R/8aMvxr1GI1oFAiPMOyXD719TVCSENciIX8bdhnlpqBZ8rTtbDUb+gult3HZ+ivBVBY7BkHJDsj90py96k5bQDfiu8uVVvn9wYYABvlcnMfuN99 ubuntu@test"
- 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEArlgZWcRP75W2/e5bKG1FEeec1OJQuw9dGVyo3TdUgVu4F0/JgBsgR2BrTuQ+mzm+N47ZkSrYwLdAJGuvL7ECxc6aouQ6AtQ/biU1gsrfuPnnUBjfAGqlP/L77lYxpLAPglx/HCCBu53gLKVt8lRDyyGZaWnB7fGlnwrn5AMjcfXsz5Ia8W6oBmxy2fxDSR9SpTs5yAzfcj37mCBtOZBwdjb54B36WpFq9BwFrEXxbvxH4aU0WSneJagicZuCUXnTg2YSURBD0jBmTrYOVRfTZzNPyagOvuIhnnakOSGkGa8s4SrC5zymZsVPdQbp6icRsu6OjKZ83Y0oiTQ4rTaeUw== [email protected]'
- 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA1HQWcDWkJYsuLu/YEwyg6H91Jy6fPbAt+WZd9oeZ+50eV37dcIZJbOALdztdrbbDCjbpFhzwsHAnzef7zV+nFhpA/bXt9JUjeGc3CEJAh9854rjoVT7lobnhi2WQHNpVOPgAPEwG4myH09tgrM+KVgDx26Zbrf7ExX7Q96ivxVmOMSoV63+0EuTClPQJ3z6j3ImGBbOz2+mybyTFlpFP4UOi8tnSOFhjhSOijcbMwru5jWUUg9M/WW2L81k/hV1hLCvbLJ6+dAq2JYoLocRBEYHLQBOF4g8VCA0WhwwjNEwK+k7Ax6CBu+37K26rz/pH8xHTKDX3IfFOinO8xl0w4Q== rmcgeer@rmcgeer-nc4010'
- name: Create slices group
group: name=slices state=present
- name: Slices sudoers file
copy: src=files/slices
dest=/etc/sudoers.d/slices
mode=0600
- name: Install files to support Docker login
copy: src=files/{{ item }}
dest=/usr/local/sbin/{{ item }}
mode=0755
with_items:
- dosh
- baseimage-docker-nsenter
- docker-bash
- name: Configure monit
copy: src=files/{{ item }}
dest=/etc/monit/conf.d/{{ item }}
with_items:
- docker.conf
- http.conf
- xvda1.conf
notify:
- restart monit
- name: Docker running
service: name=docker state=started
- name: ovs-setup script
template: src=templates/ovs-setup.sh
dest=/usr/local/sbin/ovs-setup.sh
mode=0755
notify:
- Set up OVS
- name: /etc/rc.local script
copy: src=files/rc.local
dest=/etc/rc.local
mode=0755
handlers:
- name: post Docker install
script: scripts/post-install.sh
- name: restart monit
service: name=monit state=restarted
- name: Set up OVS
shell: /usr/local/sbin/ovs-setup.sh