Merge pull request #87 from fengye87/master

Make YUM baseurl and gpgkey configurable
This commit is contained in:
Jeff Geerling 2020-11-19 12:49:39 -06:00 committed by GitHub
commit 41be8a0d07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 8 deletions

View File

@ -83,8 +83,12 @@ Options passed to `kubeadm init` when initializing the Kubernetes master. The `k
Apt repository options for Kubernetes installation. Apt repository options for Kubernetes installation.
kubernetes_yum_arch: x86_64 kubernetes_yum_arch: x86_64
kubernetes_yum_base_url: "https://packages.cloud.google.com/yum/repos/kubernetes-el7-{{ kubernetes_yum_arch }}"
kubernetes_yum_gpg_key:
- https://packages.cloud.google.com/yum/doc/yum-key.gpg
- https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
Yum repository options for Kubernetes installation. Yum repository options for Kubernetes installation. You can change `kubernete_yum_gpg_key` to a different url if you are behind a firewall or provide a trustworthy mirror. Usually in combination with changing `kubernetes_yum_base_url` as well.
kubernetes_flannel_manifest_file_rbac: https://raw.githubusercontent.com/coreos/flannel/master/Documentation/k8s-manifests/kube-flannel-rbac.yml kubernetes_flannel_manifest_file_rbac: https://raw.githubusercontent.com/coreos/flannel/master/Documentation/k8s-manifests/kube-flannel-rbac.yml
kubernetes_flannel_manifest_file: https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml kubernetes_flannel_manifest_file: https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

View File

@ -40,6 +40,10 @@ 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_base_url: "https://packages.cloud.google.com/yum/repos/kubernetes-el7-{{ kubernetes_yum_arch }}"
kubernetes_yum_gpg_key:
- https://packages.cloud.google.com/yum/doc/yum-key.gpg
- https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
# Flannel config files. # Flannel config files.
kubernetes_flannel_manifest_file_rbac: https://raw.githubusercontent.com/coreos/flannel/master/Documentation/k8s-manifests/kube-flannel-rbac.yml kubernetes_flannel_manifest_file_rbac: https://raw.githubusercontent.com/coreos/flannel/master/Documentation/k8s-manifests/kube-flannel-rbac.yml

View File

@ -6,19 +6,15 @@
enabled: true enabled: true
gpgcheck: true gpgcheck: true
repo_gpgcheck: true repo_gpgcheck: true
baseurl: https://packages.cloud.google.com/yum/repos/kubernetes-el7-{{ kubernetes_yum_arch }} baseurl: "{{ kubernetes_yum_base_url }}"
gpgkey: gpgkey: "{{ kubernetes_yum_gpg_key }}"
- 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. - name: Add Kubernetes GPG keys.
rpm_key: rpm_key:
key: "{{ item }}" key: "{{ item }}"
state: present state: present
register: kubernetes_rpm_key register: kubernetes_rpm_key
with_items: with_items: "{{ kubernetes_yum_gpg_key }}"
- 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. - name: Make cache if Kubernetes GPG key changed.
command: "yum -q makecache -y --disablerepo='*' --enablerepo='kubernetes'" command: "yum -q makecache -y --disablerepo='*' --enablerepo='kubernetes'"