---
  # Setup certs for Docker registry
  # To use self-signed certs modify /etc/docker/certs.d/$master[0]:$PORT/ca.crt
  # ca.crt is just renamed ca.pem

  # setup directories
  - name: create {{ docker_install_dir }}
    file:
      path: "{{ docker_install_dir }}"
      state: directory
  - name: create directory for certificates
    file:
      path: "{{ docker_self_signed_cert_dir }}"
      state: directory

  # copy ca
  - name: copy {{ docker_certificates_ca_file_name }}
    copy:
      src: "{{ docker_certificates_ca_path }}"
      dest: "{{ docker_self_signed_cert_dir }}/ca.crt"
      owner: "{{ docker_certificates_owner }}"
      group: "{{ docker_certificates_group }}"
      mode: "{{ docker_certificate_mode }}"
    when: docker_certificates_ca_path is defined and docker_certificates_ca_path is not empty

---
  # Setup certs for Docker registry
  # To use self-signed certs modify /etc/docker/certs.d/$master[0]:$PORT/ca.crt
  # ca.crt is just renamed ca.pem

  # setup directories
  - name: create {{ docker_install_dir }}
    file:
      path: "{{ docker_install_dir }}"
      state: directory
  - name: create directory for certificates
    file:
      path: "{{ docker_self_signed_cert_dir }}"
      state: directory

  # copy ca
  - name: copy {{ docker_certificates_ca_file_name }}
    copy:
      src: "{{ docker_certificates_ca_path }}"
      dest: "{{ docker_self_signed_cert_dir }}/ca.crt"
      owner: "{{ docker_certificates_owner }}"
      group: "{{ docker_certificates_group }}"
      mode: "{{ docker_certificate_mode }}"
    when: docker_certificates_ca_path is defined and docker_certificates_ca_path != ""

Fix merge error with Ansible docker cert
Fix merge error with Ansible docker cert
