summaryrefslogtreecommitdiffstats
path: root/kud/deployment_infra/playbooks/configure-ovn4nfv.yml
blob: cff052968bced39a054408bf3c7f6067bd95b9f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
# SPDX-license-identifier: Apache-2.0
##############################################################################
# Copyright (c) 2018
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
- import_playbook: configure-ovn.yml
- import_playbook: configure-multus.yml

- hosts: localhost
  pre_tasks:
    - name: Load kud variables
      include_vars:
        file: kud-vars.yml
  tasks:
    - name: define a CRD network object specification
      blockinfile:
        path: /tmp/ovn4nfvnetwork.yml
        create: yes
        block: |
          apiVersion: k8s.cni.cncf.io/v1
          kind: NetworkAttachmentDefinition
          metadata:
            name: ovn-networkobj
          spec:
            config: '{
               "cniVersion": "0.3.1",
               "name": "ovn4nfv-k8s-plugin",
               "type": "ovn4nfvk8s-cni"
            }'

    - name: create network objects
      shell: "/usr/local/bin/kubectl apply -f /tmp/ovn4nfvnetwork.yml"
      ignore_errors: True

    - name: create operator namespace
      shell: "/usr/local/bin/kubectl create namespace operator"
      ignore_errors: True

    - name: apply nfn operator label
      command: "/usr/local/bin/kubectl label node {{ item }} nfnType=operator --overwrite"
      with_inventory_hostnames: ovn-central

    - name: Apply NFN operator, operator roles, CRD's and ovn4nfv Daemonset
      shell: "/usr/local/bin/kubectl apply -f ../images/nfn.yml"
      ignore_errors: True