ansible/roles/k8s/tasks/setup-RedHat.yml

24 lines
617 B
YAML
Raw Normal View History

2021-02-16 16:39:53 -06:00
---
- name: Ensure Kubernetes repository exists.
yum_repository:
name: kubernetes
description: Kubernetes
enabled: true
gpgcheck: true
repo_gpgcheck: true
baseurl: "{{ kubernetes_yum_base_url }}"
gpgkey: "{{ kubernetes_yum_gpg_key }}"
- name: Add Kubernetes GPG keys.
rpm_key:
key: "{{ item }}"
state: present
register: kubernetes_rpm_key
with_items: "{{ kubernetes_yum_gpg_key }}"
- name: Make cache if Kubernetes GPG key changed.
command: "yum -q makecache -y --disablerepo='*' --enablerepo='kubernetes'"
when: kubernetes_rpm_key is changed
args:
warn: false