# HG changeset patch # User Luke Hoersten # Date 1607692121 21600 # Node ID 83e9097520a090700f21854542c1f46fcab7baf7 # Parent 3e5aac52f2bd1a46d0fc7ef640a2aa48caff5e52 Add iperf3 server service. diff -r 3e5aac52f2bd -r 83e9097520a0 iperf3/server/files/iperf3.service --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/iperf3/server/files/iperf3.service Fri Dec 11 07:08:41 2020 -0600 @@ -0,0 +1,10 @@ +[Unit] +Description=iperf3 +Requires=network.target + +[Service] +ExecStart=/usr/bin/iperf3 -s +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff -r 3e5aac52f2bd -r 83e9097520a0 iperf3/server/handlers/main.yaml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/iperf3/server/handlers/main.yaml Fri Dec 11 07:08:41 2020 -0600 @@ -0,0 +1,5 @@ +--- + +- name: restart iperf3 + become: yes + systemd: name="iperf3.service" state="restarted" daemon_reload="yes" diff -r 3e5aac52f2bd -r 83e9097520a0 iperf3/server/tasks/main.yaml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/iperf3/server/tasks/main.yaml Fri Dec 11 07:08:41 2020 -0600 @@ -0,0 +1,17 @@ +--- + +- name: apt install iperf3 + become: yes + apt: name="iperf3" + +- name: install iperf3 service + become: yes + copy: + src: "iperf3.service" + dest: "/lib/systemd/system/iperf3.service" + mode: "0644" + notify: restart iperf3 + +- name: ensure iperf3 is started + become: yes + systemd: service="iperf3.service" enabled="yes" state="started" daemon_reload="yes"