- name: Ensure registry cert directory exists become: true file: path: "/etc/docker/certs.d/{{ registry_host }}:{{ registry_port }}/" state: directory - name: Write registry TLS certificate become: true copy: content: "{{ registry_cert }}" dest: "/etc/docker/certs.d/{{ registry_host }}:{{ registry_port }}/ca.crt"