Merge pull request #200 from kubespray/docker_install_on_rhel7
Fix docker install on rhel7
This commit is contained in:
commit
5b2568adf1
6 changed files with 25 additions and 21 deletions
|
@ -91,6 +91,11 @@ matrix:
|
|||
allow_failures:
|
||||
- env: KUBE_NETWORK_PLUGIN=weave CLOUD_IMAGE=ubuntu-1404-trusty CLOUD_REGION=asia-east1-c
|
||||
- env: KUBE_NETWORK_PLUGIN=calico CLOUD_IMAGE=ubuntu-1404-trusty CLOUD_REGION=us-east1-d
|
||||
# Issue with Weave #177 to be fixed
|
||||
- env: KUBE_NETWORK_PLUGIN=weave CLOUD_IMAGE=debian-8-kubespray CLOUD_REGION=us-east1-d
|
||||
- env: KUBE_NETWORK_PLUGIN=weave CLOUD_IMAGE=centos-7-sudo CLOUD_REGION=us-central1-c
|
||||
- env: KUBE_NETWORK_PLUGIN=weave CLOUD_IMAGE=rhel-7-sudo CLOUD_REGION=europe-west1-b
|
||||
- env: KUBE_NETWORK_PLUGIN=weave CLOUD_IMAGE=ubuntu-1510-wily CLOUD_REGION=us-east1-d
|
||||
|
||||
before_install:
|
||||
# Install Ansible.
|
||||
|
|
6
roles/docker/files/rh_docker.repo
Normal file
6
roles/docker/files/rh_docker.repo
Normal file
|
@ -0,0 +1,6 @@
|
|||
[dockerrepo]
|
||||
name=Docker Repository
|
||||
baseurl=https://yum.dockerproject.org/repo/main/centos/7
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://yum.dockerproject.org/gpg
|
|
@ -38,6 +38,13 @@
|
|||
with_items: "{{ docker_repo_info.repos }}"
|
||||
when: docker_repo_info.repos|length > 0
|
||||
|
||||
- name: Configure docker repository on RedHat/CentOS
|
||||
copy:
|
||||
src: "rh_docker.repo"
|
||||
dest: "/etc/yum.repos.d/docker.repo"
|
||||
when: ansible_distribution in ["CentOS","RedHat"] and
|
||||
ansible_distribution_major_version >= 7
|
||||
|
||||
- name: ensure docker packages are installed
|
||||
action: "{{ docker_package_info.pkg_mgr }}"
|
||||
args:
|
||||
|
@ -46,15 +53,6 @@
|
|||
with_items: "{{ docker_package_info.pkgs }}"
|
||||
when: docker_package_info.pkgs|length > 0
|
||||
|
||||
- name: Centos needs xfs storage type for devicemapper if used
|
||||
lineinfile:
|
||||
dest: /etc/sysconfig/docker-storage
|
||||
line: "DOCKER_STORAGE_OPTIONS='--storage-opt dm.fs=xfs'"
|
||||
regexp: '^DOCKER_STORAGE_OPTIONS=.*$'
|
||||
state: present
|
||||
backup: yes
|
||||
when: ansible_os_family == "RedHat"
|
||||
|
||||
- meta: flush_handlers
|
||||
|
||||
- name: ensure docker service is started and enabled
|
||||
|
|
|
@ -3,7 +3,7 @@ docker_kernel_min_version: '0'
|
|||
docker_package_info:
|
||||
pkg_mgr: yum
|
||||
pkgs:
|
||||
- docker
|
||||
- docker-engine
|
||||
|
||||
docker_repo_key_info:
|
||||
pkg_key: ''
|
||||
|
|
|
@ -78,16 +78,11 @@
|
|||
ansible_distribution_major_version > 21
|
||||
changed_when: False
|
||||
|
||||
- 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 == "CentOS"
|
||||
- name: Install epel-release on RedHat/CentOS
|
||||
command: rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
|
||||
when: ansible_distribution in ["CentOS","RedHat"] and
|
||||
ansible_distribution_major_version >= 7
|
||||
changed_when: False
|
||||
|
||||
- name: Install packages requirements
|
||||
action:
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
- name: "Check certs | check if the certs have already been generated on first master"
|
||||
stat:
|
||||
path: "{{ kube_cert_dir }}/ca.pem"
|
||||
delegate_to: groups['kube-master'][0]
|
||||
delegate_to: "{{groups['kube-master'][0]}}"
|
||||
register: kubecert_master
|
||||
run_once: true
|
||||
|
||||
|
|
Loading…
Reference in a new issue