2 # SPDX-license-identifier: Apache-2.0
3 ##############################################################################
5 # All rights reserved. This program and the accompanying materials
6 # are made available under the terms of the Apache License, Version 2.0
7 # which accompanies this distribution, and is available at
8 # http://www.apache.org/licenses/LICENSE-2.0
9 ##############################################################################
10 - import_playbook: configure-ovn.yml
11 - import_playbook: configure-multus.yml
13 - hosts: kube-master:kube-node
15 PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin/"
17 - role: andrewrothstein.go
19 - name: Load kud variables
22 - name: clone ovn4nfv-k8s-plugin repo
24 repo: "{{ ovn4nfv_url }}"
25 dest: "{{ ovn4nfv_dest }}"
26 version: "{{ ovn4nfv_version }}"
28 when: ovn4nfv_source_type == "source"
29 - name: clean ovn4nfvk8s left over files
31 chdir: "{{ ovn4nfv_dest }}"
33 - name: build ovn4nfvk8s-cni
35 chdir: "{{ ovn4nfv_dest }}"
36 target: ovn4nfvk8s-cni
39 GOPATH: "{{ go_path }}"
40 - name: copy ovn4nfvk8s-cni to cni folder
41 command: "mv {{ ovn4nfv_dest }}/ovn4nfvk8s-cni /opt/cni/bin/ovn4nfvk8s-cni"
43 - name: create ovn4k8s config file
46 path: /etc/openvswitch/ovn4nfv_k8s.conf
51 logfile=/var/log/openvswitch/ovn4k8s.log
54 conf-dir=/etc/cni/net.d
58 kubeconfig=/etc/kubernetes/admin.conf
59 - name: create ovnkube logging directory
61 path: /var/log/openvswitch
66 PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin/"
69 - name: Load kud variables
72 - name: build ovn4nfvk8s
74 chdir: "{{ ovn4nfv_dest }}"
77 GOPATH: "{{ go_path }}"
78 - name: copy ovn4nfvk8s to /usr/bin folder
79 command: "mv {{ ovn4nfv_dest }}/ovn4nfvk8s /usr/bin/ovn4nfvk8s"
80 - name: create ovn4nfvk8s systemd service
82 path: /etc/systemd/system/ovn4nfvk8s.service
86 Description=OVN4NFV Kubernetes Daemon
89 ExecStart=/usr/bin/ovn4nfvk8s \
90 -k8s-kubeconfig=/etc/kubernetes/admin.conf
93 WantedBy=multi-user.target
94 - name: start ovn4nfvk8s systemd service