Browse Source

Fix docker install on rhel7

pull/200/head
Smana 8 years ago
parent
commit
936927a54f
4 changed files with 17 additions and 8 deletions
  1. 6
      roles/docker/files/rh_docker.repo
  2. 9
      roles/docker/tasks/main.yml
  3. 2
      roles/docker/vars/redhat.yml
  4. 8
      roles/kubernetes/preinstall/tasks/main.yml

6
roles/docker/files/rh_docker.repo

@ -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

9
roles/docker/tasks/main.yml

@ -38,6 +38,13 @@
with_items: "{{ docker_repo_info.repos }}" with_items: "{{ docker_repo_info.repos }}"
when: docker_repo_info.repos|length > 0 when: docker_repo_info.repos|length > 0
- name: Configure docker repository on RedHat
copy:
src: "rh_docker.repo"
dest: "/etc/yum.repos.d/docker.repo"
when: ansible_distribution == "RedHat" and
ansible_distribution_major_version > 7
- name: ensure docker packages are installed - name: ensure docker packages are installed
action: "{{ docker_package_info.pkg_mgr }}" action: "{{ docker_package_info.pkg_mgr }}"
args: args:
@ -53,7 +60,7 @@
regexp: '^DOCKER_STORAGE_OPTIONS=.*$' regexp: '^DOCKER_STORAGE_OPTIONS=.*$'
state: present state: present
backup: yes backup: yes
when: ansible_os_family == "RedHat"
when: ansible_distribution == "CentOS"
- meta: flush_handlers - meta: flush_handlers

2
roles/docker/vars/redhat.yml

@ -3,7 +3,7 @@ docker_kernel_min_version: '0'
docker_package_info: docker_package_info:
pkg_mgr: yum pkg_mgr: yum
pkgs: pkgs:
- docker
- docker-engine
docker_repo_key_info: docker_repo_key_info:
pkg_key: '' pkg_key: ''

8
roles/kubernetes/preinstall/tasks/main.yml

@ -78,16 +78,12 @@
ansible_distribution_major_version > 21 ansible_distribution_major_version > 21
changed_when: False 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
- name: Install epel-release on RedHat/CentOS
action: action:
module: "{{ ansible_pkg_mgr }}" module: "{{ ansible_pkg_mgr }}"
name: "epel-release" name: "epel-release"
state: latest state: latest
when: ansible_distribution == "CentOS"
when: ansible_distribution in ['CentOS', 'RedHat']
- name: Install packages requirements - name: Install packages requirements
action: action:

Loading…
Cancel
Save