--- - name: dhcpd installed become: true dnf: name: dhcp state: installed notify: - start dhcpd - enable dhcpd - name: copy mac addresses and config become: true copy: src: "{{ item }}" dest: "/etc/dhcp/{{ item }}" backup: yes owner: root group: root validate: /sbin/dhcpd -t -cf %s decrypt: yes notify: restart dhcpd with_items: - "host-list-las" - dhcpd.conf - name: install dhcpd config become: true template: src: dhcpd.j2 dest: /etc/dhcp/dhcpd.conf backup: yes validate: /sbin/dhcpd -t -cf %s notify: restart dhcpd