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.

55 lines
1.7 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. notify: restart docker
  11. when: http_proxy is defined or https_proxy is defined
  12. - name: get systemd version
  13. shell: systemctl --version | head -n 1 | cut -d " " -f 2
  14. register: systemd_version
  15. when: not is_atomic
  16. changed_when: false
  17. - name: Write docker.service systemd file
  18. template:
  19. src: docker.service.j2
  20. dest: /etc/systemd/system/docker.service
  21. register: docker_service_file
  22. notify: restart docker
  23. when: not (ansible_os_family in ["CoreOS", "Container Linux by CoreOS"] or is_atomic)
  24. - name: Write docker options systemd drop-in
  25. template:
  26. src: docker-options.conf.j2
  27. dest: "/etc/systemd/system/docker.service.d/docker-options.conf"
  28. notify: restart docker
  29. - name: Write docker dns systemd drop-in
  30. template:
  31. src: docker-dns.conf.j2
  32. dest: "/etc/systemd/system/docker.service.d/docker-dns.conf"
  33. notify: restart docker
  34. when: dns_mode != 'none' and resolvconf_mode == 'docker_dns'
  35. - name: Copy docker orphan clean up script to the node
  36. copy:
  37. src: cleanup-docker-orphans.sh
  38. dest: "{{ bin_dir }}/cleanup-docker-orphans.sh"
  39. mode: 0755
  40. when: docker_orphan_clean_up | bool
  41. - name: Write docker orphan clean up systemd drop-in
  42. template:
  43. src: docker-orphan-cleanup.conf.j2
  44. dest: "/etc/systemd/system/docker.service.d/docker-orphan-cleanup.conf"
  45. notify: restart docker
  46. when: docker_orphan_clean_up | bool
  47. - meta: flush_handlers