Ansible Playbook: Docker 17.03.2 (Rancher 2.0)

Ansible Playbook to install Docker 17.03.2 on Centos. Rancher 2.0

- name: Install Docker to Rancher2.0
  hosts: inventory_name
  tasks:
    - name: Install Docker Deps
      loop:
        - "yum-utils"
        - "device-mapper-persistent-data"
        - "lvm2"
      yum:
        name: "{{ item }}"
        state: latest
    - name: Add docker repo
      shell: |
        yum-config-manager \
        --add-repo \
        https://download.docker.com/linux/centos/docker-ce.repo
    - name: Install Docker
      shell: |
        yum install -y --setopt=obsoletes=0 \
        docker-ce-17.03.2.ce-1.el7.centos.x86_64 \
        docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch
    - name: enable and start Docker
      systemd:
        name: docker
        state: started
        enabled: True