- name: Fail if firmware files are missing ansible.builtin.stat: path: "roles/tftp/files/firmware/{{ item }}" register: firmware_stat loop: "{{ firmware_files }}" failed_when: not firmware_stat.stat.exists - name: Install TFTP server ansible.builtin.package: name: tftpd-hpa state: present - name: Enable and start TFTP service ansible.builtin.service: name: tftpd-hpa state: started enabled: true - name: Configure TFTP server ansible.builtin.template: src: tftpd-hpa.j2 dest: /etc/default/tftpd-hpa owner: root group: root mode: '0644' notify: Restart TFTP - name: Upload SEPMAC configuration files ansible.builtin.template: src: SEPMAC.cnf.xml.j2 dest: "{{ tftp_root_dir }}/{{ item.mac }}.cnf.xml" mode: '0644' loop: "{{ extensions }}" - name: Upload firmware files ansible.builtin.copy: src: "firmware/{{ item }}" dest: "{{ tftp_root_dir }}/{{ item }}" mode: '0644' loop: "{{ firmware_files }}" - name: Upload dialplan file ansible.builtin.copy: src: "dialplan.xml" dest: "{{ tftp_root_dir }}/dialplan.xml" mode: '0644'