summaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/kubernetes/roles/kargo
diff options
context:
space:
mode:
authorJustin chi <chigang@huawei.com>2018-03-09 03:51:29 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-09 03:51:29 +0000
commit6bc387014a355483900cd5542961096e8b307cf4 (patch)
treeafacb1701655cc058316984e46eb52a138c23d83 /deploy/adapters/ansible/kubernetes/roles/kargo
parentba134f4d524bd885cd40c346f32fcbfb5e99d4c5 (diff)
parent3ad4238fbf8a8043cfbe6623b22b8d16e82a408f (diff)
Merge "add a multus with sriov interfaces installation"
Diffstat (limited to 'deploy/adapters/ansible/kubernetes/roles/kargo')
-rw-r--r--deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml45
1 files changed, 45 insertions, 0 deletions
diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml
index 6d947623..b9d9c234 100644
--- a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml
+++ b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml
@@ -217,6 +217,51 @@
when:
- stor4nfv is defined and stor4nfv == "Enable"
+- name: copy sriov playbook to kargo
+ copy:
+ src: "{{ run_dir }}/roles/sriov"
+ dest: /opt/kargo_k8s/roles/network_plugin
+
+- name: copy sriov-apps playbook to kargo
+ copy:
+ src: "{{ run_dir }}/roles/sriov-apps/"
+ dest: /opt/kargo_k8s/roles/kubernetes-apps/network_plugin/sriov
+
+- name: append sriov to network plugin
+ blockinfile:
+ path: /opt/kargo_k8s/roles/network_plugin/meta/main.yml
+ block: " - role: network_plugin/sriov\n when: kube_network_plugin == 'sriov'\n \
+ tags: sriov\n"
+
+- name: append sriov apps to network plugin
+ blockinfile:
+ path: /opt/kargo_k8s/roles/kubernetes-apps/network_plugin/meta/main.yml
+ block: " - role: kubernetes-apps/network_plugin/sriov\n \
+ when: kube_network_plugin == 'sriov'\n tags: sriov\n"
+
+- name: append sriov to valid kube_network_plugin list
+ replace:
+ path: "{{ item.path }}"
+ regexp: "{{ item.regexp }}"
+ replace: "{{ item.replace }}"
+ with_items:
+ - {path: "/opt/kargo_k8s/roles/kubernetes/master/templates/manifests/\
+kube-controller-manager.manifest.j2",
+ regexp: '"cloud", "flannel"',
+ replace: '"cloud", "flannel", "sriov"'}
+ - {path: '/opt/kargo_k8s/roles/kubernetes/node/templates/kubelet.kubeadm.env.j2',
+ regexp: '"calico", "canal", "flannel", "weave"',
+ replace: '"calico", "canal", "flannel", "weave", "sriov"'}
+ - {path: '/opt/kargo_k8s/roles/kubernetes/node/templates/kubelet.standard.env.j2',
+ regexp: '"calico", "canal", "flannel", "weave"',
+ replace: '"calico", "canal", "flannel", "weave", "sriov"'}
+ - {path: '/opt/kargo_k8s/roles/kubernetes/node/templates/kubelet.rkt.service.j2',
+ regexp: '"calico", "weave", "canal", "flannel"',
+ replace: '"calico", "weave", "canal", "flannel", "sriov"'}
+ - {path: '/opt/kargo_k8s/roles/kubernetes/preinstall/tasks/main.yml',
+ regexp: '"calico", "weave", "canal", "flannel"',
+ replace: '"calico", "weave", "canal", "flannel", "sriov"'}
+
- name: run kargo playbook
shell: |
cd /opt/kargo_k8s