Skip to content

Commit

Permalink
roles: docker: Ensure service is started if docker is already installed
Browse files Browse the repository at this point in the history
If the 'docker' package is already installed, then the handlers will not
run and the service will not be (re-)started. As such, lets make sure
that the service is started even if the packages are already installed.
  • Loading branch information
Markos Chandras committed Apr 11, 2018
1 parent 44a0626 commit cdb63a8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions roles/docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@
notify: restart docker
when: not (ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] or is_atomic) and (docker_package_info.pkgs|length > 0)

- name: ensure service is started if docker packages are already present
service:
name: docker
state: started
when: docker_task_result is not changed

- name: flush handlers so we can wait for docker to come up
meta: flush_handlers

Expand Down

0 comments on commit cdb63a8

Please sign in to comment.