3 - hosts: coe-master:coe-minion1:coe-minion2
5 gopath: "{{ ansible_env.HOME }}/go"
6 coe_path: "{{ gopath }}/src/git.opendaylight.org/gerrit/p/coe.git"
8 PATH: "{{ ansible_env.HOME }}:/usr/local/go/bin:{{ ansible_env.HOME }}/go/bin:/usr/local/go/bin:/usr/bin:/bin"
12 - name: Make CNI config directory
17 - name: Generate cni config
19 src: "{{ conf_path }}"
20 dest: /etc/cni/net.d/odlovs-cni.conf
22 - name: Create $HOME/go/bin
24 path: "{{ ansible_env.HOME }}/go/bin"
27 shell: curl https://glide.sh/get | sh
29 creates: "{{ gopath }}/bin/glide"
30 - name: Fetch COE git repository
32 repo: 'https://git.opendaylight.org/gerrit/p/coe.git'
33 dest: "{{ coe_path }}"
34 - name: Fetch odl-cni dependencies with glide
35 shell: glide install -v
37 chdir: "{{ coe_path }}/odlCNIPlugin/odlovs-cni"
38 creates: "{{ coe_path }}/odlCNIPlugin/odlovs-cni/vendor"
39 - name: Build odlovs-cni
42 chdir: "{{ coe_path }}/odlCNIPlugin/odlovs-cni"
43 creates: "{{ coe_path }}/odlCNIPlugin/odlovs-cni/odlovs-cni"
44 - name: Install odlovs-cni
46 src: "{{ coe_path }}/odlCNIPlugin/odlovs-cni/odlovs-cni"
47 dest: "/opt/cni/bin/odlovs-cni"
54 gopath: "{{ ansible_env.HOME}}/go"
55 coe_path: "{{ gopath }}/src/git.opendaylight.org/gerrit/p/coe.git"
57 PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin:{{ ansible_env.HOME }}/go/bin:/usr/local/go/bin:{{ gopath }}/bin:/usr/bin:/bin"
58 GOPATH: "{{ gopath }}"
61 - name: Fetch watcher dependencies with glide
62 shell: glide install -v
64 chdir: "{{ coe_path }}/watcher"
65 creates: "{{ coe_path }}/watcher/vendor"
69 chdir: "{{ coe_path }}/watcher"
70 creates: "{{ coe_path }}/watcher/watcher"
71 - name: Copy watcher to /usr/local/bin
73 src: "{{ coe_path }}/watcher/watcher"
74 dest: /usr/local/bin/watcher
78 - name: Copy coe.yaml to /etc
80 src: "{{ watcher_path }}"
86 - hosts: coe-master:coe-minion1:coe-minion2
88 - name: Set OVS Manager
89 shell: ovs-vsctl set-manager tcp:{{ manager_ip }}:{{ manager_port }} && touch /tmp/ovs-set-manager
91 creates: /tmp/ovs-set-manager
93 - name: Enable auto-tunnelling
94 shell: ovs-vsctl set O . other_config:local_ip={{ overlay_ip }} && touch /tmp/enable-auto-tunnel
96 creates: /tmp/enable-auto-tunnel
98 - name: Enable docker in systemd
109 - name: Disable swapfile
112 - name: Run kubeadm init
113 shell: kubeadm init --apiserver-advertise-address={{ k8s_advertise_address }} > /tmp/k8s-output
115 creates: /tmp/k8s-output
117 - name: Create join script
118 shell: echo "#!/bin/sh" > /tmp/join-k8s.sh && cat /tmp/k8s-output | grep "kubeadm join" | sed -e 's/^[[:space:]]*//g' >> /tmp/join-k8s.sh
120 creates: /tmp/join-k8s.sh
121 - name: Fetch join script
123 src: /tmp/join-k8s.sh
124 dest: /tmp/join-k8s.sh
126 - name: Make kube directory
128 path: "{{ ansible_env.HOME }}/.kube"
130 - name: Copy kubeconfig
132 src: /etc/kubernetes/admin.conf
133 dest: "{{ ansible_env.HOME }}/.kube/config"
140 shell: nohup watcher odl </dev/null >/tmp/watcher.out 2>&1 &
142 creates: /tmp/watcher.out
144 - hosts: coe-minion1:coe-minion2
146 - name: Disable swapfile
149 - name: Copy join file
151 src: /tmp/join-k8s.sh
152 dest: /tmp/join-k8s.sh
156 shell: /tmp/join-k8s.sh