From 5ca4fbf2cfe781efedc7c078acaa826c6ad39b10 Mon Sep 17 00:00:00 2001 From: spmfox Date: Tue, 27 Aug 2024 17:34:55 -0400 Subject: converting to roles, converting from runlabels to quadlet ~ breaking change --- roles/host/tasks/unprivileged-ports.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 roles/host/tasks/unprivileged-ports.yml (limited to 'roles/host/tasks/unprivileged-ports.yml') diff --git a/roles/host/tasks/unprivileged-ports.yml b/roles/host/tasks/unprivileged-ports.yml new file mode 100644 index 0000000..003646a --- /dev/null +++ b/roles/host/tasks/unprivileged-ports.yml @@ -0,0 +1,17 @@ +- name: Unprivileged port block + block: + - name: Confirm port 80 and above is allowed for unprivileged use + ansible.builtin.shell: "sysctl net.ipv4.ip_unprivileged_port_start |grep 80" + + rescue: + - name: Set sysctl parameter net.ipv4.ip_unprivileged_port_start=80 + ansible.builtin.lineinfile: + path: "/etc/sysctl.conf" + regexp: "^net.ipv4.ip_unprivileged_port_start=80" + line: "net.ipv4.ip_unprivileged_port_start=80" + + - name: Reload sysctl + ansible.builtin.shell: "sysctl -p /etc/sysctl.conf" + + - name: Confirm port 80 and above is allowed for unprivileged use + ansible.builtin.shell: "sysctl net.ipv4.ip_unprivileged_port_start |grep 80" -- cgit