From 6a91dfcfe4cc8356727a54cfa5e248a9c5ccd096 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Sat, 13 Apr 2024 21:15:18 +0200 Subject: [PATCH] Fix regexp bug --- slococo/playground/roles/ssh_config/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/slococo/playground/roles/ssh_config/tasks/main.yml b/slococo/playground/roles/ssh_config/tasks/main.yml index 9dad7fc..9ab86e3 100644 --- a/slococo/playground/roles/ssh_config/tasks/main.yml +++ b/slococo/playground/roles/ssh_config/tasks/main.yml @@ -2,10 +2,10 @@ - name: Check SSH daemon configuration ansible.builtin.lineinfile: path: /etc/ssh/sshd_config - regexp: "[^#]{{ item.key }}.*" + regexp: "^{{ item.key }}" line: "{{ item.key }} {{ item.value }}" state: present validate: "sshd -t -f %s" mode: 0644 loop: "{{ sshd_options | dict2items }}" - become: true + become: true \ No newline at end of file