mirror of
https://github.com/geerlingguy/ansible-role-kubernetes.git
synced 2024-11-18 19:10:39 +01:00
Fix install on CentOS 7.
This commit is contained in:
parent
d0816d08ad
commit
4b1d773779
@ -5,7 +5,6 @@ env:
|
||||
- distro: centos7
|
||||
- distro: ubuntu1604
|
||||
- distro: debian9
|
||||
- distro: fedora27
|
||||
|
||||
script:
|
||||
# Configure test script so we can run extra tests after playbook is run.
|
||||
|
@ -38,6 +38,10 @@ TODO.
|
||||
kubernetes_apt_repository: "deb http://apt.kubernetes.io/ kubernetes-xenial {{ kubernetes_apt_release_channel }}"
|
||||
kubernetes_apt_ignore_key_error: False
|
||||
|
||||
TODO.
|
||||
|
||||
kubernetes_yum_arch: x86_64
|
||||
|
||||
TODO.
|
||||
|
||||
## Dependencies
|
||||
|
@ -20,4 +20,3 @@ kubernetes_apt_repository: "deb http://apt.kubernetes.io/ kubernetes-xenial {{ k
|
||||
kubernetes_apt_ignore_key_error: False
|
||||
|
||||
kubernetes_yum_arch: x86_64
|
||||
kubernetes_yum_repo_url: "https://packages.cloud.google.com/yum/repos/kubernetes-el7-{{ kubernetes_yum_arch }}"
|
||||
|
@ -11,9 +11,6 @@ galaxy_info:
|
||||
- name: EL
|
||||
versions:
|
||||
- 7
|
||||
- name: Fedora
|
||||
versions:
|
||||
- all
|
||||
- name: Debian
|
||||
versions:
|
||||
- stretch
|
||||
|
@ -66,6 +66,8 @@
|
||||
with_items:
|
||||
- kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
|
||||
- kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/k8s-manifests/kube-flannel-rbac.yml
|
||||
register: flannel_networking_result
|
||||
changed_when: "'unchanged' not in flannel_networking_result.stdout"
|
||||
|
||||
# TODO: Check if taint exists with something like `kubectl describe nodes`
|
||||
# instead of using kubernetes_init_stat.stat.exists check.
|
||||
|
@ -1,13 +1,26 @@
|
||||
---
|
||||
- name: Add Kubernetes GPG key.
|
||||
rpm_key:
|
||||
key: https://packages.cloud.google.com/yum/doc/yum-key.gpg
|
||||
state: present
|
||||
- name: Ensure Kubernetes repository exists.
|
||||
yum_repository:
|
||||
name: kubernetes
|
||||
description: Kubernetes
|
||||
enabled: yes
|
||||
gpgcheck: yes
|
||||
repo_gpgcheck: yes
|
||||
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 repository.
|
||||
get_url:
|
||||
url: "{{ kubernetes_yum_repo_url }}"
|
||||
dest: '/etc/yum.repos.d/kubernetes.repo'
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
- name: Add Kubernetes GPG keys.
|
||||
rpm_key:
|
||||
key: "{{ item }}"
|
||||
state: present
|
||||
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
|
||||
|
||||
- name: Make cache if Kubernetes GPG key changed.
|
||||
command: "yum -q makecache -y --disablerepo='*' --enablerepo='kubernetes'"
|
||||
when: kubernetes_rpm_key is changed
|
||||
warn: no
|
||||
|
Loading…
Reference in New Issue
Block a user