---
- hosts: all
  vars:
    docker_group: docker
  tasks:

    # until docker-install role on redhat distros is fixed by:
    # https://review.openstack.org/#/c/634934

    - name: create docker group
      become: true
      group:
        name: "{{ docker_group }}"
        system: true

    - name: Add user to docker group
      become: true
      user:
        name: "{{ ansible_user }}"
        groups:
          - "{{ docker_group | default('docker') }}"

    - include_role:
        name: install-docker
      vars:
        use_upstream_docker: true

    - name: Create user config dir
      file:
        path: "{{ ansible_user_dir }}/.docker/"
        owner: "{{ ansible_user }}"
        state: directory

    - name: Enable experimental commands in user config
      copy:
        content: |
          {
              "experimental": "enabled"
          }
        dest: "{{ ansible_user_dir }}/.docker/config.json"

---
- hosts: all
  vars:
    docker_group: docker
  tasks:

    # until docker-install role on redhat distros is fixed by:
    # https://review.openstack.org/#/c/634934

    - name: create docker group
      become: true
      group:
        name: "{{ docker_group }}"
        system: true

    - name: Add user to docker group
      become: true
      user:
        name: "{{ ansible_user }}"
        groups:
          - "{{ docker_group | default('docker') }}"

    - include_role:
        name: ensure-docker
      vars:
        use_upstream_docker: true

    - name: Create user config dir
      file:
        path: "{{ ansible_user_dir }}/.docker/"
        owner: "{{ ansible_user }}"
        state: directory

    - name: Enable experimental commands in user config
      copy:
        content: |
          {
              "experimental": "enabled"
          }
        dest: "{{ ansible_user_dir }}/.docker/config.json"

Use ensure-docker instead of install-docker role
Use ensure-docker instead of install-docker role

Install-docker role fails and tells it to switch to ensure-docker.
Doing the same fixes the issue.

Change-Id: I95ac9ccafa6eac2531b605926625feba10a9f52a
Signed-off-by: Chandan Kumar (raukadah) <37614c4f126be5146599b9d19fe2ba37ae0ea495@redhat.com>
