- name: Deploy docker.service (template)
  template:
    src:   templates/docker.service.j2
    dest:  /etc/systemd/system/docker.service
    owner: vagrant
    group: root
    mode:  0775
  notify:
    - Restart Docker

- name: Install docker-compose
  pip:
    name: docker-compose
    state: latest

#############################
# Apparmor profile
#############################

- name: Fix AppArmor profile
  lineinfile:
    dest:        '/etc/apparmor.d/docker'
    insertafter: '[\s]*capability'
    line:        '  ptrace peer=docker-default,'
    state:       present
  notify:
    - Reload AppArmor

---

- name: Deploy docker.service (template)
  template:
    src:   templates/docker.service.j2
    dest:  /etc/systemd/system/docker.service
    owner: vagrant
    group: root
    mode:  0775
  notify:
    - Restart Docker

- name: Install docker-compose
  pip:
    name: docker-compose
    state: latest

#############################
# Apparmor profile
#############################

- name: Fix AppArmor profile
  lineinfile:
    dest:        '/etc/apparmor.d/docker'
    insertafter: '[\s]*capability'
    line:        '  ptrace peer=docker-default,'
    state:       present
  notify:
    - Reload AppArmor

#############################
# User
#############################

- name: Add vagrant to docker group
  user:
    name:   'vagrant'
    groups: 'docker'
    append: yes

Add missing docker group for vagrant
Add missing docker group for vagrant
