--- - name: Download zonefile uri: url: '{{ bind_zonefile_base_url }}/{{ item }}' return_content: yes delegate_to: localhost register: zonefile when: bind_zonefile_base_url != "" - name: Install zonefile copy: dest: '/etc/bind/zonefiles/{{ item }}' content: '{{ zonefile.content }}' become: yes notify: Restart bind when: bind_zonefile_base_url != "" - name: Copy zonefile copy: src: '{{ bind_zonefile_base_folder }}/{{ item }}' dest: '/etc/bind/zonefiles/{{ item }}' become: yes notify: Restart bind when: bind_zonefile_base_folder != ""