geerlingguy.ansible-role-ku.../tasks/setup-RedHat.yml

22 lines
654 B
YAML
Raw Normal View History

2018-05-09 16:19:11 +02:00
---
2018-05-09 23:09:32 +02:00
- name: Ensure Kubernetes repository exists.
yum_repository:
name: kubernetes
description: Kubernetes
2018-09-28 05:17:50 +02:00
enabled: true
2021-08-23 10:11:06 +02:00
gpgcheck: "{{ kubernetes_yum_gpg_check }}"
repo_gpgcheck: "{{ kubernetes_yum_repo_gpg_check }}"
baseurl: "{{ kubernetes_yum_base_url }}"
gpgkey: "{{ kubernetes_yum_gpg_key }}"
2018-05-09 23:09:32 +02:00
- name: Add Kubernetes GPG keys.
2018-05-09 16:19:11 +02:00
rpm_key:
2018-05-09 23:09:32 +02:00
key: "{{ item }}"
2018-05-09 16:19:11 +02:00
state: present
2018-05-09 23:09:32 +02:00
register: kubernetes_rpm_key
with_items: "{{ kubernetes_yum_gpg_key }}"
2018-05-09 16:19:11 +02:00
2018-05-09 23:09:32 +02:00
- name: Make cache if Kubernetes GPG key changed.
command: "yum -q makecache -y --disablerepo='*' --enablerepo='kubernetes'"
when: kubernetes_rpm_key is changed