aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/adapters/ansible/kubernetes/roles/kargo
diff options
context:
space:
mode:
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