From 881be9b741fb04e2b7607f8798580b35aec2e721 Mon Sep 17 00:00:00 2001 From: Chad Swenson Date: Tue, 22 Jan 2019 15:44:11 -0600 Subject: [PATCH] Fix epel_enabled and RHEL support in bootstrap-os Looks like `epel_enabled` was not configured for the epel install in `bootstrap-centos.yml`. Also, there were no conditionals that would trigger bootstrap for RHEL. --- roles/bootstrap-os/defaults/main.yml | 3 +++ roles/bootstrap-os/tasks/bootstrap-centos.yml | 1 + roles/bootstrap-os/tasks/main.yml | 2 +- roles/container-engine/docker/templates/docker.service.j2 | 6 +++--- roles/kubespray-defaults/defaults/main.yaml | 3 +++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/roles/bootstrap-os/defaults/main.yml b/roles/bootstrap-os/defaults/main.yml index 06412a2e0..ea838ddb2 100644 --- a/roles/bootstrap-os/defaults/main.yml +++ b/roles/bootstrap-os/defaults/main.yml @@ -5,3 +5,6 @@ pip_python_coreos_modules: override_system_hostname: true coreos_auto_upgrade: true + +# Install epel repo on Centos/RHEL +epel_enabled: false \ No newline at end of file diff --git a/roles/bootstrap-os/tasks/bootstrap-centos.yml b/roles/bootstrap-os/tasks/bootstrap-centos.yml index 519a43733..2ff91d5fe 100644 --- a/roles/bootstrap-os/tasks/bootstrap-centos.yml +++ b/roles/bootstrap-os/tasks/bootstrap-centos.yml @@ -52,6 +52,7 @@ name: epel-release state: present when: + - epel_enabled - not is_atomic - package_python_pip.results | length != 0 diff --git a/roles/bootstrap-os/tasks/main.yml b/roles/bootstrap-os/tasks/main.yml index dedfe03cf..1bb24ee57 100644 --- a/roles/bootstrap-os/tasks/main.yml +++ b/roles/bootstrap-os/tasks/main.yml @@ -18,7 +18,7 @@ when: '"Fedora" in os_release.stdout' - include_tasks: bootstrap-centos.yml - when: '"CentOS" in os_release.stdout' + when: '"CentOS" in os_release.stdout or "Red Hat Enterprise Linux" in os_release.stdout' - include_tasks: bootstrap-opensuse.yml when: '"OpenSUSE" in os_release.stdout' diff --git a/roles/container-engine/docker/templates/docker.service.j2 b/roles/container-engine/docker/templates/docker.service.j2 index 74d303eb9..c9a879659 100644 --- a/roles/container-engine/docker/templates/docker.service.j2 +++ b/roles/container-engine/docker/templates/docker.service.j2 @@ -2,13 +2,13 @@ Description=Docker Application Container Engine Documentation=http://docs.docker.com {% if ansible_os_family == "RedHat" %} -After=network.target docker-storage-setup.service{% if installed_docker_version.stdout is version('18.09.1', '>=') %} containerd.service{% endif %} +After=network.target docker-storage-setup.service{{ ' containerd.service' if installed_docker_version.stdout is version('18.09.1', '>=') else '' }} Wants=docker-storage-setup.service {% elif ansible_os_family == "Debian" %} -After=network.target docker.socket{% if installed_docker_version.stdout is version('18.09.1', '>=') %} containerd.service{% endif %} +After=network.target docker.socket{{ ' containerd.service' if installed_docker_version.stdout is version('18.09.1', '>=') else '' }} Wants=docker.socket {% elif ansible_os_family == "Suse" %} -After=network.target{% if installed_docker_version.stdout is version('18.09.1', '>=') %} containerd.service{% endif %} +After=network.target{{ ' containerd.service' if installed_docker_version.stdout is version('18.09.1', '>=') else '' }} {% endif %} [Service] diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml index 0c4116baf..05227040d 100644 --- a/roles/kubespray-defaults/defaults/main.yaml +++ b/roles/kubespray-defaults/defaults/main.yaml @@ -44,6 +44,9 @@ local_release_dir: "/tmp/releases" # Random shifts for retrying failed ops like pushing/downloading retry_stagger: 5 +# Install epel repo on Centos/RHEL +epel_enabled: false + # DNS configuration. # Kubernetes cluster name, also will be used as DNS domain cluster_name: cluster.local