diff --git a/roles/kubectl/defaults/main.yml b/roles/kubectl/defaults/main.yml index e7a8109..89df962 100644 --- a/roles/kubectl/defaults/main.yml +++ b/roles/kubectl/defaults/main.yml @@ -1,3 +1,4 @@ --- # code: language=ansible # defaults file for kubectl +kubectl_version: "1.29" diff --git a/roles/kubectl/tasks/debian.yml b/roles/kubectl/tasks/debian.yml index eec326e..f1dcbee 100644 --- a/roles/kubectl/tasks/debian.yml +++ b/roles/kubectl/tasks/debian.yml @@ -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 diff --git a/roles/kubectl/tasks/redhat.yml b/roles/kubectl/tasks/redhat.yml index f3ffd98..7a8af16 100644 --- a/roles/kubectl/tasks/redhat.yml +++ b/roles/kubectl/tasks/redhat.yml @@ -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