From c0cf506fb46686551a23ce8c7bd09de33fd22b79 Mon Sep 17 00:00:00 2001 From: Smana Date: Sat, 13 Feb 2016 11:59:46 +0100 Subject: [PATCH] install epel-release on RHEL7 --- roles/kubernetes/master/tasks/main.yml | 6 ------ roles/kubernetes/master/tasks/start.yml | 5 +++-- roles/kubernetes/preinstall/tasks/main.yml | 13 ++++++++----- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/roles/kubernetes/master/tasks/main.yml b/roles/kubernetes/master/tasks/main.yml index b974d13a2..d3a8dad68 100644 --- a/roles/kubernetes/master/tasks/main.yml +++ b/roles/kubernetes/master/tasks/main.yml @@ -91,9 +91,3 @@ name: kubelet state: restarted changed_when: false - -- name: restart kube-apiserver - service: - name: kube-apiserver - state: restarted - when: secret_changed | default(false) diff --git a/roles/kubernetes/master/tasks/start.yml b/roles/kubernetes/master/tasks/start.yml index c8b2e7927..9cd247c42 100644 --- a/roles/kubernetes/master/tasks/start.yml +++ b/roles/kubernetes/master/tasks/start.yml @@ -11,11 +11,12 @@ name: kube-apiserver state: restarted enabled: yes - when: restart_apimaster is defined and restart_apimaster == True + when: ( restart_apimaster is defined and restart_apimaster == True) or + secret_changed | default(false) - name: Enable apiserver service: name: kube-apiserver enabled: yes state: started - when: restart_apimaster is not defined or restart_apimaster == False \ No newline at end of file + when: restart_apimaster is not defined or restart_apimaster == False diff --git a/roles/kubernetes/preinstall/tasks/main.yml b/roles/kubernetes/preinstall/tasks/main.yml index 88aef9d6f..fc06d12b7 100644 --- a/roles/kubernetes/preinstall/tasks/main.yml +++ b/roles/kubernetes/preinstall/tasks/main.yml @@ -59,23 +59,26 @@ when: ansible_pkg_mgr == 'yum' - name: Install python-apt for Debian distribs - shell: apt-get install -y python-apt + command: apt-get install -y python-apt when: ansible_os_family == "Debian" changed_when: False - name: Install python-dnf for latest RedHat versions - shell: dnf install -y python-dnf yum + command: dnf install -y python-dnf yum when: ansible_distribution == "Fedora" and ansible_distribution_major_version > 21 changed_when: False -- name: Install epel-release for RedHat and CentOS distribs +- name: Install epel-release on RHEL + command: rpm -ivh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm + when: ansible_distribution == "RedHat" + +- name: Install epel-release on CentOS action: module: "{{ ansible_pkg_mgr }}" name: "epel-release" state: latest - when: ansible_distribution == "RedHat" or - ansible_distribution == "CentOS" + when: ansible_distribution == "CentOS" - name: Install packages requirements action: