Skip to content

Commit

Permalink
add ability to specify version and updated the repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Eric Anderson committed Mar 5, 2024
1 parent 8981a8c commit 4784ab4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions roles/kubectl/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# code: language=ansible
# defaults file for kubectl
kubectl_version: "1.29"
4 changes: 2 additions & 2 deletions roles/kubectl/tasks/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

- name: Kubectl | Debian | Add an Apt signing key
ansible.builtin.apt_key:
url: https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key
url: https://pkgs.k8s.io/core:/stable:/v{{ kubectl_version }}/deb/Release.key
state: present

- name: Kubectl | Debian | Add the kubectl repository
ansible.builtin.apt_repository:
repo: deb https://pkgs.k8s.io/core:/stable:/v1.29/deb/ /
repo: deb https://pkgs.k8s.io/core:/stable:/v{{ kubectl_version }}/deb/ /
state: present
filename: kubernetes

Expand Down
7 changes: 2 additions & 5 deletions roles/kubectl/tasks/redhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@
ansible.builtin.yum_repository:
name: kubernetes
description: Kubernetes
baseurl: https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
baseurl: https://pkgs.k8s.io/core:/stable:/v{{ kubectl_version }}/rpm/
enabled: true
gpgcheck: true
repo_gpgcheck: true
gpgkey: >-
https://packages.cloud.google.com/yum/doc/yum-key.gpg
https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
gpgkey: https://pkgs.k8s.io/core:/stable:/v{{ kubectl_version }}/rpm/repodata/repomd.xml.key
file: kubernetes

- name: Kukectl | Redhat | Install kubectl
Expand Down

0 comments on commit 4784ab4

Please sign in to comment.