From 10624f8c9044f65f98e908be80921aeb0b8e68a0 Mon Sep 17 00:00:00 2001 From: djpbessems Date: Tue, 15 Jun 2021 11:11:56 +0200 Subject: [PATCH] Fix regex patterns --- .../files/ansible_payload/roles/users/tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/users/tasks/main.yml b/ansible/roles/firstboot/files/ansible_payload/roles/users/tasks/main.yml index 0d5da91..92cda5d 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/users/tasks/main.yml +++ b/ansible/roles/firstboot/files/ansible_payload/roles/users/tasks/main.yml @@ -16,8 +16,8 @@ line: "{{ item.line }}" state: "{{ item.state }}" loop: - - { regex: '$#PasswordAuthentication', line: 'PasswordAuthentication no', state: present} - - { regex: '$PasswordAuthentication yes', line: 'PasswordAuthentication yes', state: absent} + - { regex: '^#PasswordAuthentication', line: 'PasswordAuthentication no', state: present} + - { regex: '^PasswordAuthentication yes', line: 'PasswordAuthentication yes', state: absent} - name: Delete 'ubuntu' user ansible.builtin.user: name: ubuntu