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

28 lines
868 B
YAML
Raw Permalink 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
gpgcheck: true
repo_gpgcheck: true
2018-05-09 23:09:32 +02:00
baseurl: https://packages.cloud.google.com/yum/repos/kubernetes-el7-{{ kubernetes_yum_arch }}
gpgkey:
- https://packages.cloud.google.com/yum/doc/yum-key.gpg
- https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
- 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:
- https://packages.cloud.google.com/yum/doc/yum-key.gpg
- https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
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
args:
2018-09-28 05:17:50 +02:00
warn: false