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://raw.githubusercontent.com/golang/dep/master/install.sh | sh
29 creates: "{{ gopath }}/bin/dep"
30 - name: Fetch COE git repository
32 repo: 'https://git.opendaylight.org/gerrit/p/coe.git'
33 dest: "{{ coe_path }}"
34 - name: Fetch COE dep patch
35 shell: git config --add user.name "vagrant" && git config --add user.email "coe@local" && git fetch https://git.opendaylight.org/gerrit/coe refs/changes/55/72855/4 && git cherry-pick FETCH_HEAD && touch /tmp/coe-patched
37 chdir: "{{ coe_path }}"
38 creates: /tmp/coe-patched
39 - name: Fetch odl-cni dependencies with dep
40 shell: dep ensure -vendor-only
42 chdir: "{{ coe_path }}/odlCNIPlugin/odlovs-cni"
43 creates: "{{ coe_path }}/odlCNIPlugin/odlovs-cni/vendor"
44 - name: Build odlovs-cni
47 chdir: "{{ coe_path }}/odlCNIPlugin/odlovs-cni"
48 creates: "{{ coe_path }}/odlCNIPlugin/odlovs-cni/odlovs-cni"
49 - name: Install odlovs-cni
51 src: "{{ coe_path }}/odlCNIPlugin/odlovs-cni/odlovs-cni"
52 dest: "/opt/cni/bin/odlovs-cni"
59 gopath: "{{ ansible_env.HOME}}/go"
60 coe_path: "{{ gopath }}/src/git.opendaylight.org/gerrit/p/coe.git"
62 PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin:{{ ansible_env.HOME }}/go/bin:/usr/local/go/bin:{{ gopath }}/bin:/usr/bin:/bin"
63 GOPATH: "{{ gopath }}"
66 - name: Fetch watcher dependencies with dep
67 shell: dep ensure -vendor-only
69 chdir: "{{ coe_path }}/watcher"
70 creates: "{{ coe_path }}/watcher/vendor"
74 chdir: "{{ coe_path }}/watcher"
75 creates: "{{ coe_path }}/watcher/watcher"
76 - name: Copy watcher to /usr/local/bin
78 src: "{{ coe_path }}/watcher/watcher"
79 dest: /usr/local/bin/watcher
83 - name: Copy coe.yaml to /etc
85 src: "{{ watcher_path }}"
91 - hosts: coe-master:coe-minion1:coe-minion2
93 - name: Set OVS Manager
94 shell: ovs-vsctl set-manager tcp:{{ manager_ip }}:{{ manager_port }} && touch /tmp/ovs-set-manager
96 creates: /tmp/ovs-set-manager
98 - name: Enable auto-tunnelling
99 shell: ovs-vsctl set O . other_config:local_ip={{ overlay_ip }} && touch /tmp/enable-auto-tunnel
101 creates: /tmp/enable-auto-tunnel
103 - name: Enable docker in systemd
114 - name: Disable swapfile
117 - name: Run kubeadm init
118 shell: kubeadm init --apiserver-advertise-address={{ k8s_advertise_address }} > /tmp/k8s-output
120 creates: /tmp/k8s-output
122 - name: Create join script
123 shell: echo "#!/bin/sh" > /tmp/join-k8s.sh && cat /tmp/k8s-output | grep "kubeadm join" | sed -e 's/^[[:space:]]*//g' >> /tmp/join-k8s.sh
125 creates: /tmp/join-k8s.sh
126 - name: Fetch join script
128 src: /tmp/join-k8s.sh
129 dest: /tmp/join-k8s.sh
131 - name: Make kube directory
133 path: "{{ ansible_env.HOME }}/.kube"
135 - name: Copy kubeconfig
137 src: /etc/kubernetes/admin.conf
138 dest: "{{ ansible_env.HOME }}/.kube/config"
145 shell: nohup watcher odl </dev/null >/tmp/watcher.out 2>&1 &
147 creates: /tmp/watcher.out
149 - hosts: coe-minion1:coe-minion2
151 - name: Disable swapfile
154 - name: Copy join file
156 src: /tmp/join-k8s.sh
157 dest: /tmp/join-k8s.sh
161 shell: /tmp/join-k8s.sh