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: Show gerrit details
34 - "Fetch COE git repository https://git.opendaylight.org/gerrit/p/coe.git"
35 - "gerrit_branch {{ gerrit_branch }}"
36 - "gerrit_refspec {{ gerrit_refspec }}"
37 - name: Fetch COE git repository
39 repo: "https://git.opendaylight.org/gerrit/p/coe.git"
40 version: "{{ gerrit_branch }}"
41 refspec: "{{ gerrit_refspec }}"
42 dest: "{{ coe_path }}"
43 - name: List COE git repository recent patches
45 shell: "git --no-pager log --pretty=format:'%h %<(30)%ad %<(30)%cd %<(20,trunc)%an%d %s' -n10"
47 chdir: "{{ coe_path }}"
48 register: git_log_output
49 - name: git log header
52 msg="Hash Author Date Commit Date Author Subject"
53 - name: git log output
56 var=git_log_output.stdout_lines
57 - name: Fetch odl-cni dependencies with dep
58 shell: dep ensure -vendor-only
60 chdir: "{{ coe_path }}/odlCNIPlugin/odlovs-cni"
61 creates: "{{ coe_path }}/odlCNIPlugin/odlovs-cni/vendor"
62 - name: Build odlovs-cni
65 chdir: "{{ coe_path }}/odlCNIPlugin/odlovs-cni"
66 creates: "{{ coe_path }}/odlCNIPlugin/odlovs-cni/odlovs-cni"
67 - name: Install odlovs-cni
69 src: "{{ coe_path }}/odlCNIPlugin/odlovs-cni/odlovs-cni"
70 dest: "/opt/cni/bin/odlovs-cni"
77 gopath: "{{ ansible_env.HOME}}/go"
78 coe_path: "{{ gopath }}/src/git.opendaylight.org/gerrit/p/coe.git"
80 PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin:{{ ansible_env.HOME }}/go/bin:/usr/local/go/bin:{{ gopath }}/bin:/usr/bin:/bin"
81 GOPATH: "{{ gopath }}"
84 - name: Fetch watcher dependencies with dep
85 shell: dep ensure -vendor-only
87 chdir: "{{ coe_path }}/watcher"
88 creates: "{{ coe_path }}/watcher/vendor"
92 chdir: "{{ coe_path }}/watcher"
93 creates: "{{ coe_path }}/watcher/watcher"
94 - name: Copy watcher to /usr/local/bin
96 src: "{{ coe_path }}/watcher/watcher"
97 dest: /usr/local/bin/watcher
101 - name: Copy coe.yaml to /etc
103 src: "{{ watcher_path }}"
111 - name: Set OVS Manager
112 shell: ovs-vsctl set-manager tcp:{{ manager_ip }}:{{ manager_port }} && touch /tmp/ovs-set-manager
114 creates: /tmp/ovs-set-manager
116 - name: Enable auto-tunnelling
117 shell: ovs-vsctl set O . other_config:local_ip={{ overlay_ip }} && touch /tmp/enable-auto-tunnel
119 creates: /tmp/enable-auto-tunnel
121 - name: Enable docker in systemd
132 - name: Disable swapfile
135 - name: Run kubeadm init
136 shell: kubeadm init --apiserver-advertise-address={{ k8s_advertise_address }} > /tmp/k8s-output
138 creates: /tmp/k8s-output
140 - name: Create join script
141 shell: echo "#!/bin/sh" > /tmp/join-k8s.sh && cat /tmp/k8s-output | grep "kubeadm join" | sed -e 's/^[[:space:]]*//g' >> /tmp/join-k8s.sh
143 creates: /tmp/join-k8s.sh
144 - name: Fetch join script
146 src: /tmp/join-k8s.sh
147 dest: /tmp/join-k8s.sh
149 - name: Make kube directory
151 path: "{{ ansible_env.HOME }}/.kube"
153 - name: Copy kubeconfig
155 src: /etc/kubernetes/admin.conf
156 dest: "{{ ansible_env.HOME }}/.kube/config"
163 shell: nohup watcher odl </dev/null >/tmp/watcher.out 2>&1 &
165 creates: /tmp/watcher.out
169 - name: Disable swapfile
172 - name: Copy join file
174 src: /tmp/join-k8s.sh
175 dest: /tmp/join-k8s.sh
179 shell: /tmp/join-k8s.sh