diff --git a/files/helper-tftp.service b/files/helper-tftp.service new file mode 100644 index 0000000..53dc828 --- /dev/null +++ b/files/helper-tftp.service @@ -0,0 +1,11 @@ +[Unit] +Description=Starts TFTP on boot because of reasons +After=network.target + +[Service] +Type=simple +ExecStart=/usr/local/bin/start-tftp.sh +TimeoutStartSec=0 + +[Install] +WantedBy=default.target diff --git a/files/start-tftp.sh b/files/start-tftp.sh new file mode 100755 index 0000000..56a586b --- /dev/null +++ b/files/start-tftp.sh @@ -0,0 +1,4 @@ +#!/bin/bash +/usr/bin/systemctl start tftp > /dev/null 2>&1 +## +## diff --git a/tasks/main.yml b/tasks/main.yml index ffaee26..c119e08 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -153,6 +153,25 @@ mode: 0555 when: not staticips + - name: Installing TFTP Systemd helper + copy: + src: ../files/start-tftp.sh + dest: /usr/local/bin/start-tftp.sh + mode: '0555' + when: not staticips + + - name: Installing TFTP Systemd unit file + copy: + src: ../files/helper-tftp.service + dest: /etc/systemd/system/helper-tftp.service + mode: '0655' + when: not staticips + + - name: Systemd daemon reload + systemd: + daemon_reload: yes + when: not staticips + - name: Starting services service: name: "{{ item }}" @@ -171,6 +190,7 @@ with_items: - dhcpd - tftp + - helper-tftp when: not staticips - name: Unmasking Services