From 3654a0dc3dbdfd917cfaa43b4ca2a964a3dbb87c Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 26 Jun 2022 17:06:35 +0200 Subject: use a toplevel block to tag all tasks with 'ssh' --- tasks/main.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'tasks/main.yml') diff --git a/tasks/main.yml b/tasks/main.yml index 8b6afb1..264679a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,16 +1,18 @@ --- - name: Disable PasswordAuthentication - lineinfile: - path: /etc/ssh/sshd_config - regexp: "^[#]?\\s?PasswordAuthentication" - line: "PasswordAuthentication no" tags: - ssh - register: disable_passwds + block: + - name: Disable PasswordAuthentication in sshd config + lineinfile: + path: /etc/ssh/sshd_config + regexp: "^[#]?\\s?PasswordAuthentication" + line: "PasswordAuthentication no" + register: disable_passwds -- name: Restart service sshd - when: disable_passwds.changed - ansible.builtin.service: - name: sshd - state: restarted + - name: Restart service sshd + when: disable_passwds.changed + ansible.builtin.service: + name: sshd + state: restarted -- cgit v1.2.3