Fix install on CentOS 7.

This commit is contained in:
Jeff Geerling 2018-05-09 16:09:32 -05:00
parent d0816d08ad
commit 4b1d773779
6 changed files with 30 additions and 16 deletions

View File

@ -5,7 +5,6 @@ env:
- distro: centos7 - distro: centos7
- distro: ubuntu1604 - distro: ubuntu1604
- distro: debian9 - distro: debian9
- distro: fedora27
script: script:
# Configure test script so we can run extra tests after playbook is run. # Configure test script so we can run extra tests after playbook is run.

View File

@ -38,6 +38,10 @@ TODO.
kubernetes_apt_repository: "deb http://apt.kubernetes.io/ kubernetes-xenial {{ kubernetes_apt_release_channel }}" kubernetes_apt_repository: "deb http://apt.kubernetes.io/ kubernetes-xenial {{ kubernetes_apt_release_channel }}"
kubernetes_apt_ignore_key_error: False kubernetes_apt_ignore_key_error: False
TODO.
kubernetes_yum_arch: x86_64
TODO. TODO.
## Dependencies ## Dependencies

View File

@ -20,4 +20,3 @@ kubernetes_apt_repository: "deb http://apt.kubernetes.io/ kubernetes-xenial {{ k
kubernetes_apt_ignore_key_error: False kubernetes_apt_ignore_key_error: False
kubernetes_yum_arch: x86_64 kubernetes_yum_arch: x86_64
kubernetes_yum_repo_url: "https://packages.cloud.google.com/yum/repos/kubernetes-el7-{{ kubernetes_yum_arch }}"

View File

@ -11,9 +11,6 @@ galaxy_info:
- name: EL - name: EL
versions: versions:
- 7 - 7
- name: Fedora
versions:
- all
- name: Debian - name: Debian
versions: versions:
- stretch - stretch

View File

@ -66,6 +66,8 @@
with_items: 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/kube-flannel.yml
- kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/k8s-manifests/kube-flannel-rbac.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` # TODO: Check if taint exists with something like `kubectl describe nodes`
# instead of using kubernetes_init_stat.stat.exists check. # instead of using kubernetes_init_stat.stat.exists check.

View File

@ -1,13 +1,26 @@
--- ---
- name: Add Kubernetes GPG key. - name: Ensure Kubernetes repository exists.
rpm_key: yum_repository:
key: https://packages.cloud.google.com/yum/doc/yum-key.gpg name: kubernetes
state: present 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. - name: Add Kubernetes GPG keys.
get_url: rpm_key:
url: "{{ kubernetes_yum_repo_url }}" key: "{{ item }}"
dest: '/etc/yum.repos.d/kubernetes.repo' state: present
owner: root register: kubernetes_rpm_key
group: root with_items:
mode: 0644 - 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