Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
micafer committed Feb 27, 2024
1 parent 4ab8c21 commit b6fafe9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
12 changes: 5 additions & 7 deletions tasks/Debian.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
---
- name: Add repo for new Kubernetes versions
block:
when: "kube_version is version('1.24', '>=')"
- block:

- name: Set kube_minor_version
set_fact:
Expand All @@ -16,10 +13,9 @@
- name: Add kubernetes repo
apt_repository: repo='deb https://pkgs.k8s.io/core:/stable:/v{{ kube_minor_version }}/deb/ /' state=present update_cache=yes

when: "kube_version is version('1.24', '>=')"

- name: Add repo for old Kubernetes versions
block:
when: "kube_version is version('1.24', '<')"
- block:

- name: Add repo key
get_url:
Expand All @@ -41,6 +37,8 @@
- name: Add kubernetes repo
apt_repository: repo='deb http://apt.kubernetes.io/ kubernetes-xenial main' state=present update_cache=yes

when: "kube_version is version('1.24', '<')"

- name: Install kubernetes packages
apt: name=kubelet={{ kube_version }}*,kubeadm={{ kube_version }}*,kubectl={{ kube_version }}*
when: kube_version != "latest" and (kubeadm_output.stdout == '' or kubeadm_output.stdout is version(kube_version, '<='))
Expand Down
16 changes: 9 additions & 7 deletions tasks/RedHat.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
---
- name: Add repo for new Kubernetes versions
block:
when: "kube_version is version('1.24', '>=')"
- block:

- name: Set kube_minor_version
set_fact:
Expand All @@ -25,10 +23,12 @@
key: https://pkgs.k8s.io/core:/stable:/v{{ kube_minor_version }}/rpm/repodata/repomd.xml.key
state: present

- name: Add repo for old Kubernetes versions
block:
when: "kube_version is version('1.24', '<')"
- copy:
when: "kube_version is version('1.24', '>=')"

- block:

- name: Set repo file
copy:
dest: /etc/yum.repos.d/kubernetes.repo
content: |
[kubernetes]
Expand All @@ -44,6 +44,8 @@
key: https://packages.cloud.google.com/yum/doc/yum-key.gpg
state: present

when: "kube_version is version('1.24', '<')"

- name: Install kubernetes packages
package: name=psmisc,kubelet-{{kube_version}},kubeadm-{{kube_version}},kubectl-{{kube_version}},yum-plugin-versionlock state=present update_cache=yes
when: kube_version != "latest" and (kubeadm_output.stdout == '' or kubeadm_output.stdout is version(kube_version, '<='))
Expand Down

0 comments on commit b6fafe9

Please sign in to comment.