From 36cbf9861f003085054cfe320515958e21b67c2f Mon Sep 17 00:00:00 2001 From: kevinnls Date: Fri, 23 Oct 2026 23:01:21 +0530 Subject: [PATCH] track selinux change to alt ssh port --- playbooks/setup/server/natsuco.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/playbooks/setup/server/natsuco.yaml b/playbooks/setup/server/natsuco.yaml index c22fa88..f4170a0 100644 --- a/playbooks/setup/server/natsuco.yaml +++ b/playbooks/setup/server/natsuco.yaml @@ -20,4 +20,7 @@ state: present name: policycoreutils-python-utils - name: give sshd access to alt port on selinux - command: "/usr/sbin/semanage port -a -t ssh_port_t -p tcp {{ alt_ssh_port }}" + register: result_change_to_alt_port + ignore_errors: true + changed_when: "'already defined' not in result_change_to_alt_port.stdout" + command: semanage port -a -t ssh_port_t -p tcp {{ alt_ssh_port }}