ansible 2.9 error in starting docker service on centos7

I have a sample playbook to install docker inside Centos7 container. All the tasks run fine but I am getting an error while starting docker service.

playbook.yml

- name: Example play
  hosts: docker_restart
  roles:
    - name: "docker-role"

docker-role/tasks/main.yml

---
- name: "Installing Docker Prerequisite packages"
  yum:
    name: "{{ item }}"
    state: latest
  with_items:
    - yum-utils
    - device-mapper-persistent-data
    - lvm2

- name: "Configuring docker-ce repo"
  get_url:
    url: https://download.docker.com/linux/centos/docker-ce.repo
    dest: /etc/yum.repos.d/docker-ce.repo
    mode: 0644

- name: " Installing Docker latest version"
  yum:
    name: docker-ce
    state: present

- name: Install Docker.
  package:
    name: docker-ce
    state: present
  notify: restart docker

- name: Ensure Docker is started and enabled at boot.
  service:
    name: docker
    state: started
    enabled: yes

inventory.yml

$ cat inventory.yml 
all:
  hosts:
    docker_restart:
      ansible_connection: docker
      ansible_python_interpreter: python

Output:

$ ansible-playbook -i inventory.yml playbook.yml 

PLAY [Example play] ************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] *********************************************************************************************************************************************************************************************************
ok: [docker_restart]

TASK [docker-role : Installing Docker Prerequisite packages] *******************************************************************************************************************************************************************
ok: [docker_restart] => (item=[u'yum-utils', u'device-mapper-persistent-data', u'lvm2'])

TASK [docker-role : Configuring docker-ce repo] ********************************************************************************************************************************************************************************
ok: [docker_restart]

TASK [docker-role :  Installing Docker latest version] *************************************************************************************************************************************************************************
ok: [docker_restart]

TASK [docker-role : Install Docker.] *******************************************************************************************************************************************************************************************
ok: [docker_restart]

TASK [docker-role : Ensure Docker is started and enabled at boot.] *************************************************************************************************************************************************************
fatal: [docker_restart]: FAILED! => {"changed": false, "msg": "Could not find the requested service docker: host"}
    to retry, use: --limit @/Users/<<username>>/ansible_docker_setup/playbook.retry

PLAY RECAP *********************************************************************************************************************************************************************************************************************
docker_restart             : ok=5    changed=0    unreachable=0    failed=1   

After looking around for a possible solution, I came across docker-compose and tried updating my task as follows:

- name: Ensure Docker is started and enabled at boot
  docker_compose:
    restarted: yes

However, I get an error:

Error msg:

$ansible-playbook -i inventory.yml playbook.yml 

PLAY [Example play] **************************************************

TASK [Gathering Facts] *************************************************
ok: [docker_restart]

TASK [docker-role : Remove docker if installed from CentOS repo] ***********************************
[DEPRECATION WARNING]: Invoking "yum" only once while using a loop via squash_actions is deprecated. Instead of using a loop to supply multiple items and specifying 
`name: "{{ item }}"`, please use `name: ['docker', 'docker-client', 'docker-client-latest', 'docker-common', 'docker-latest', 'docker-latest-logrotate', 'docker-
logrotate', 'docker-engine']` and remove the loop. This feature will be removed in version 2.11. Deprecation warnings can be disabled by setting 
deprecation_warnings=False in ansible.cfg.
ok: [docker_restart] => (item=['docker', 'docker-client', 'docker-client-latest', 'docker-common', 'docker-latest', 'docker-latest-logrotate', 'docker-logrotate', 'docker-engine'])

TASK [docker-role : Installing Prerequisite packages] **************************************
[DEPRECATION WARNING]: Invoking "yum" only once while using a loop via squash_actions is deprecated. Instead of using a loop to supply multiple items and specifying 
`name: "{{ item }}"`, please use `name: ['yum-utils', 'device-mapper-persistent-data', 'lvm2']` and remove the loop. This feature will be removed in version 2.11. 
Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ok: [docker_restart] => (item=['yum-utils', 'device-mapper-persistent-data', 'lvm2'])

TASK [docker-role : Configuring docker-ce repo] ****************************************
ok: [docker_restart]

TASK [docker-role :  Installing Docker latest version] *************************************
ok: [docker_restart]

TASK [docker-role :  Ensure Docker is started and enabled at boot] *************************************
fatal: [docker_restart]: FAILED! => {"changed": false, "msg": "Error connecting: Error while fetching server API version: ('Connection aborted.', error(2, 'No such file or directory'))"}

PLAY RECAP *****************************************************
docker_restart             : ok=5    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

When I run docker version on the docker container, I figure that daemon isn’t running.

And while even trying to start it manually using sudo systemctl start docker, I get error:

Docker- D-Bus connection: Operation not permitted

Any pointers on this?

Source: Docker Questions