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
33 - "Fetch COE git repository https://git.opendaylight.org/gerrit/p/coe.git"
34 - "gerrit_branch {{ gerrit_branch }}"
35 - "gerrit_refspec {{ gerrit_refspec }}"
36 - name: Fetch COE git repository
38 repo: "https://git.opendaylight.org/gerrit/p/coe.git"
39 version: "{{ gerrit_branch }}"
40 refspec: "{{ gerrit_refspec }}"
41 dest: "{{ coe_path }}"
42 - name: List COE git repository recent patches
43 shell: "git --no-pager log --pretty=format:'%h %<(30)%ad %<(30)%cd %<(20,trunc)%an%d %s' -n10"
45 chdir: "{{ coe_path }}"
46 - name: Fetch odl-cni dependencies with dep
47 shell: dep ensure -vendor-only
49 chdir: "{{ coe_path }}/odlCNIPlugin/odlovs-cni"
50 creates: "{{ coe_path }}/odlCNIPlugin/odlovs-cni/vendor"
51 - name: Build odlovs-cni
54 chdir: "{{ coe_path }}/odlCNIPlugin/odlovs-cni"
55 creates: "{{ coe_path }}/odlCNIPlugin/odlovs-cni/odlovs-cni"
56 - name: Install odlovs-cni
58 src: "{{ coe_path }}/odlCNIPlugin/odlovs-cni/odlovs-cni"
59 dest: "/opt/cni/bin/odlovs-cni"
66 gopath: "{{ ansible_env.HOME}}/go"
67 coe_path: "{{ gopath }}/src/git.opendaylight.org/gerrit/p/coe.git"
69 PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin:{{ ansible_env.HOME }}/go/bin:/usr/local/go/bin:{{ gopath }}/bin:/usr/bin:/bin"
70 GOPATH: "{{ gopath }}"
73 - name: Fetch watcher dependencies with dep
74 shell: dep ensure -vendor-only
76 chdir: "{{ coe_path }}/watcher"
77 creates: "{{ coe_path }}/watcher/vendor"
81 chdir: "{{ coe_path }}/watcher"
82 creates: "{{ coe_path }}/watcher/watcher"
83 - name: Copy watcher to /usr/local/bin
85 src: "{{ coe_path }}/watcher/watcher"
86 dest: /usr/local/bin/watcher
90 - name: Copy coe.yaml to /etc
92 src: "{{ watcher_path }}"
100 - name: Set OVS Manager
101 shell: ovs-vsctl set-manager tcp:{{ manager_ip }}:{{ manager_port }} && touch /tmp/ovs-set-manager
103 creates: /tmp/ovs-set-manager
105 - name: Enable auto-tunnelling
106 shell: ovs-vsctl set O . other_config:local_ip={{ overlay_ip }} && touch /tmp/enable-auto-tunnel
108 creates: /tmp/enable-auto-tunnel
110 - name: Enable docker in systemd
121 - name: Disable swapfile
124 - name: Run kubeadm init
125 shell: kubeadm init --apiserver-advertise-address={{ k8s_advertise_address }} > /tmp/k8s-output
127 creates: /tmp/k8s-output
129 - name: Create join script
130 shell: echo "#!/bin/sh" > /tmp/join-k8s.sh && cat /tmp/k8s-output | grep "kubeadm join" | sed -e 's/^[[:space:]]*//g' >> /tmp/join-k8s.sh
132 creates: /tmp/join-k8s.sh
133 - name: Fetch join script
135 src: /tmp/join-k8s.sh
136 dest: /tmp/join-k8s.sh
138 - name: Make kube directory
140 path: "{{ ansible_env.HOME }}/.kube"
142 - name: Copy kubeconfig
144 src: /etc/kubernetes/admin.conf
145 dest: "{{ ansible_env.HOME }}/.kube/config"
152 shell: nohup watcher odl </dev/null >/tmp/watcher.out 2>&1 &
154 creates: /tmp/watcher.out
158 - name: Disable swapfile
161 - name: Copy join file
163 src: /tmp/join-k8s.sh
164 dest: /tmp/join-k8s.sh
168 shell: /tmp/join-k8s.sh