--- # test file for docker.ubuntu role on vagrant - hosts: ubuntu-1604 become: yes gather_facts: no tasks: - name: Install python raw: export DEBIAN_FRONTEND=noninteractive && apt-get -y install python python-simplejson - hosts: all become: yes vars: docker_group_members: - "{{ ansible_user }}" roles: - role: docker.ubuntu kernel_update_and_reboot_permitted: yes tasks: - name: Create a dummy container docker_container: name: foobar pull: true image: busybox state: started when: _pip_install_docker or pip_install_docker_compose register: container_creation - name: Remove the dummy container docker_container: name: foobar state: absent when: container_creation.changed - name: Remove the dummy image docker_image: name: busybox state: absent when: container_creation.changed