Skip to content

Commit

Permalink
add sed workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
jarpat committed Apr 2, 2024
1 parent 655bab5 commit 7891538
Showing 1 changed file with 9 additions and 27 deletions.
36 changes: 9 additions & 27 deletions roles/kubernetes/control_plane/init/primary/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,46 +14,28 @@
- update

# TODO ADD DOC, workaround for https://github.com/kube-vip/kube-vip/issues/684
- name: Update admin.conf for K8s 1.29+
- name: Update kube-vip.yaml to use super-admin.conf for kubeadm init in 1.29+

Check failure on line 17 in roles/kubernetes/control_plane/init/primary/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / ansible-lint

command-instead-of-module

sed used in place of template, replace or lineinfile module
ansible.builtin.shell: >
sed -i 's#path: /etc/kubernetes/admin.conf#path: /etc/kubernetes/super-admin.conf#' /etc/kubernetes/manifests/kube-vip.yaml
when: kubernetes_version is version("1.29.0", "ge", version_type="semver")
tags:
- install
- update
when:
kubernetes_version is version("1.29.0", "ge", version_type="semver")
block:
- name: Back up admin.conf
ansible.builtin.copy:
src: "/etc/kubernetes/admin.conf"
dest: "/etc/kubernetes/admin.conf.bak"
remote_src: true
tags:
- install
- update
- name: Replace admin with super.conf
ansible.builtin.copy:
src: "/etc/kubernetes/super-admin.conf"
dest: "/etc/kubernetes/admin.conf"
remote_src: true
tags:
- install
- update

# TODO: pod-network-cidr can conflict locally check with IT to ensure correct range.
- name: Run kubeadm init
ansible.builtin.command: kubeadm init --config /etc/kubernetes/kubeadm-config.yaml --upload-certs
tags:
- install

- name: Restore admin.conf
ansible.builtin.copy:
src: "/etc/kubernetes/admin.conf.bak"
dest: "/etc/kubernetes/admin.conf"
remote_src: true
# TODO ADD DOC, workaround for https://github.com/kube-vip/kube-vip/issues/684
- name: Restore kube-vip.yaml to use admin.conf for kubeadm init in 1.29+

Check failure on line 32 in roles/kubernetes/control_plane/init/primary/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / ansible-lint

command-instead-of-module

sed used in place of template, replace or lineinfile module
ansible.builtin.shell: >
sed -i 's#path: /etc/kubernetes/super-admin.conf#path: /etc/kubernetes/admin.conf#' /etc/kubernetes/manifests/kube-vip.yaml
when: kubernetes_version is version("1.29.0", "ge", version_type="semver")
tags:
- install
- update
when:
kubernetes_version is version('1.29.0', 'ge', version_type='semver')"

- name: Setup kubernetes .kube directory
ansible.builtin.file:
Expand Down

0 comments on commit 7891538

Please sign in to comment.