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"
26 - name: Show gerrit details
30 - "Fetch COE git repository https://git.opendaylight.org/gerrit/p/coe.git"
31 - "gerrit_branch {{ gerrit_branch }}"
32 - "gerrit_refspec {{ gerrit_refspec }}"
33 - name: Fetch COE git repository
35 repo: "https://git.opendaylight.org/gerrit/p/coe.git"
36 version: "{{ gerrit_branch }}"
37 refspec: "{{ gerrit_refspec }}"
38 dest: "{{ coe_path }}"
39 - name: List COE git repository recent patches
41 shell: "git --no-pager log --pretty=format:'%h %<(30)%ad %<(30)%cd %<(20,trunc)%an%d %s' -n10"
43 chdir: "{{ coe_path }}"
44 register: git_log_output
45 - name: git log header
48 msg="Hash Author Date Commit Date Author Subject"
49 - name: git log output
52 var=git_log_output.stdout_lines
53 - name: Build odlovs-cni
54 shell: GO111MODULE=on go build
56 chdir: "{{ coe_path }}/odlCNIPlugin/odlovs-cni"
57 creates: "{{ coe_path }}/odlCNIPlugin/odlovs-cni/odlovs-cni"
58 - name: Install odlovs-cni
60 src: "{{ coe_path }}/odlCNIPlugin/odlovs-cni/odlovs-cni"
61 dest: "/opt/cni/bin/odlovs-cni"
68 gopath: "{{ ansible_env.HOME}}/go"
69 coe_path: "{{ gopath }}/src/git.opendaylight.org/gerrit/p/coe.git"
71 PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin:{{ ansible_env.HOME }}/go/bin:/usr/local/go/bin:{{ gopath }}/bin:/usr/bin:/bin"
72 GOPATH: "{{ gopath }}"
76 shell: GO111MODULE=on go build
78 chdir: "{{ coe_path }}/watcher"
79 creates: "{{ coe_path }}/watcher/watcher"
80 - name: Copy watcher to /usr/local/bin
82 src: "{{ coe_path }}/watcher/watcher"
83 dest: /usr/local/bin/watcher
87 - name: Copy coe.yaml to /etc
89 src: "{{ watcher_path }}"
97 - name: Set OVS Manager
98 shell: ovs-vsctl set-manager tcp:{{ manager_ip }}:{{ manager_port }} && touch /tmp/ovs-set-manager
100 creates: /tmp/ovs-set-manager
102 - name: Enable auto-tunnelling
103 shell: ovs-vsctl set O . other_config:local_ip={{ overlay_ip }} && touch /tmp/enable-auto-tunnel
105 creates: /tmp/enable-auto-tunnel
107 - name: Enable docker in systemd
118 - name: Disable swapfile
121 - name: Run kubeadm init
122 shell: kubeadm init --apiserver-advertise-address={{ k8s_advertise_address }} > /tmp/k8s-output
124 creates: /tmp/k8s-output
126 - name: Create join script
127 shell: echo "#!/bin/sh" > /tmp/join-k8s.sh && cat /tmp/k8s-output | grep "kubeadm join" | sed -e 's/^[[:space:]]*//g' >> /tmp/join-k8s.sh
129 creates: /tmp/join-k8s.sh
130 - name: Fetch join script
132 src: /tmp/join-k8s.sh
133 dest: /tmp/join-k8s.sh
135 - name: Make kube directory
137 path: "{{ ansible_env.HOME }}/.kube"
139 - name: Copy kubeconfig
141 src: /etc/kubernetes/admin.conf
142 dest: "{{ ansible_env.HOME }}/.kube/config"
149 shell: nohup watcher odl </dev/null >/tmp/watcher.out 2>&1 &
151 creates: /tmp/watcher.out
155 - name: Disable swapfile
158 - name: Copy join file
160 src: /tmp/join-k8s.sh
161 dest: /tmp/join-k8s.sh
165 shell: /tmp/join-k8s.sh