use docker repository to install on CentOS

This commit is contained in:
Smana
2016-04-11 09:33:08 +02:00
parent 936927a54f
commit 48a85ce8f8
4 changed files with 13 additions and 18 deletions

View File

@@ -38,12 +38,12 @@
with_items: "{{ docker_repo_info.repos }}"
when: docker_repo_info.repos|length > 0
- name: Configure docker repository on RedHat
- name: Configure docker repository on RedHat/CentOS
copy:
src: "rh_docker.repo"
dest: "/etc/yum.repos.d/docker.repo"
when: ansible_distribution == "RedHat" and
ansible_distribution_major_version > 7
when: ansible_distribution in ["CentOS","RedHat"] and
ansible_distribution_major_version >= 7
- name: ensure docker packages are installed
action: "{{ docker_package_info.pkg_mgr }}"
@@ -53,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_distribution == "CentOS"
- meta: flush_handlers
- name: ensure docker service is started and enabled