aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/kubernetes/roles/kargo
diff options
context:
space:
mode:
authorYifei Xue <xueyifei@huawei.com>2018-02-22 00:38:54 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-02-22 00:38:54 +0000
commitcfafdfa4bad20b380e542e6b2d4e240b2a931097 (patch)
tree6db62ef1ea06d06dd90927f482615b636bd5d004 /deploy/adapters/ansible/kubernetes/roles/kargo
parentc8d1b105be71eb831a7068c2b7d5e1530d590a11 (diff)
parent098208121bba3ef6d576976c2e975c56f89ae901 (diff)
Merge "add a multus with 2 fannel 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, 44 insertions, 1 deletions
diff --git a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml
index f68eec43..187e2a52 100644
--- a/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml
+++ b/deploy/adapters/ansible/kubernetes/roles/kargo/tasks/main.yml
@@ -57,7 +57,6 @@
- netaddr
- jinja2
-
- name: copy inventories generate script
copy:
src: generate_inventories.py
@@ -156,6 +155,50 @@
- extra-vars-{{ ansible_architecture }}.yml
- extra-vars.yml
+- name: copy 2flannel playbook to kargo
+ copy:
+ src: "{{ run_dir }}/roles/2flannel"
+ dest: /opt/kargo_k8s/roles/network_plugin
+
+- name: copy 2flannel-apps playbook to kargo
+ copy:
+ src: "{{ run_dir }}/roles/2flannel-apps/"
+ dest: /opt/kargo_k8s/roles/kubernetes-apps/network_plugin/2flannel
+
+- name: append 2flannel to network plugin
+ blockinfile:
+ path: /opt/kargo_k8s/roles/network_plugin/meta/main.yml
+ block: " - role: network_plugin/2flannel\n \
+ when: kube_network_plugin == '2flannel'\n tags: 2flannel\n"
+
+- name: append 2flannel apps to network plugin
+ blockinfile:
+ path: /opt/kargo_k8s/roles/kubernetes-apps/network_plugin/meta/main.yml
+ block: " - role: kubernetes-apps/network_plugin/2flannel\n \
+ when: kube_network_plugin == '2flannel'\n tags: 2flannel\n"
+
+- name: append 2flannel to valid kube_network_plugin list
+ replace:
+ path: "/opt/kargo_k8s/roles/kubernetes/{{ item.path }}"
+ regexp: "{{ item.regexp }}"
+ replace: "{{ item.replace }}"
+ with_items:
+ - {path: 'master/templates/manifests/kube-controller-manager.manifest.j2',
+ regexp: '"cloud", "flannel"',
+ replace: '"cloud", "flannel", "2flannel"'}
+ - {path: 'node/templates/kubelet.kubeadm.env.j2',
+ regexp: '"calico", "canal", "flannel", "weave"',
+ replace: '"calico", "canal", "flannel", "weave", "2flannel"'}
+ - {path: 'node/templates/kubelet.standard.env.j2',
+ regexp: '"calico", "canal", "flannel", "weave"',
+ replace: '"calico", "canal", "flannel", "weave", "2flannel"'}
+ - {path: 'node/templates/kubelet.rkt.service.j2',
+ regexp: '"calico", "weave", "canal", "flannel"',
+ replace: '"calico", "weave", "canal", "flannel", "2flannel"'}
+ - {path: 'preinstall/tasks/main.yml',
+ regexp: '"calico", "weave", "canal", "flannel"',
+ replace: '"calico", "weave", "canal", "flannel", "2flannel"'}
+
- name: run kargo playbook
shell: |
cd /opt/kargo_k8s