You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.2 KiB

  1. ---
  2. - name: Create docker service systemd directory if it doesn't exist
  3. file:
  4. path: /etc/systemd/system/docker.service.d
  5. state: directory
  6. - name: Write docker proxy drop-in
  7. template:
  8. src: http-proxy.conf.j2
  9. dest: /etc/systemd/system/docker.service.d/http-proxy.conf
  10. when: http_proxy is defined or https_proxy is defined or no_proxy is defined
  11. - name: Write docker.service systemd file
  12. template:
  13. src: docker.service.j2
  14. dest: /etc/systemd/system/docker.service
  15. register: docker_service_file
  16. when: not (ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] or is_atomic)
  17. - name: Write docker.service systemd file for atomic
  18. template:
  19. src: docker_atomic.service.j2
  20. dest: /etc/systemd/system/docker.service
  21. notify: restart docker
  22. when: is_atomic
  23. - name: Write docker options systemd drop-in
  24. template:
  25. src: docker-options.conf.j2
  26. dest: "/etc/systemd/system/docker.service.d/docker-options.conf"
  27. notify: restart docker
  28. - name: Write docker dns systemd drop-in
  29. template:
  30. src: docker-dns.conf.j2
  31. dest: "/etc/systemd/system/docker.service.d/docker-dns.conf"
  32. notify: restart docker
  33. when: dns_mode != 'none' and resolvconf_mode == 'docker_dns'
  34. - meta: flush_handlers