---
- name: Copying over rndc.conf (designate_backend_external)
  template:
    src: "{{ node_custom_config }}/designate/rndc.conf"
    dest: "{{ node_config_directory }}/{{ item.key }}/rndc.conf"
    mode: "0660"
  become: true
  when:
    - designate_backend_external == 'bind9'
    - item.key in [ "designate-worker" ]
  with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}"

- name: Copying over rndc.key (designate_backend_external)
  template:
    src: "{{ node_custom_config }}/designate/rndc.key"
    dest: "{{ node_config_directory }}/{{ item.key }}/rndc.key"
    mode: "0660"
  become: true
  when:
    - designate_backend_external == 'bind9'
    - item.key in [ "designate-worker" ]
  with_dict: "{{ designate_services | select_services_enabled_and_mapped_to_host }}"
