diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2022-06-26 17:06:35 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2022-06-26 17:06:35 +0200 |
| commit | 3654a0dc3dbdfd917cfaa43b4ca2a964a3dbb87c (patch) | |
| tree | 5c0e0615cd61a9fbfad7827f5e1a4407a092cbf7 | |
| parent | 1c8d50308ef875fcb0b0a89e79228d5c1ae2f898 (diff) | |
| download | sshd_disable_passwd_login-3654a0dc3dbdfd917cfaa43b4ca2a964a3dbb87c.tar.gz sshd_disable_passwd_login-3654a0dc3dbdfd917cfaa43b4ca2a964a3dbb87c.zip | |
use a toplevel block to tag all tasks with 'ssh'
| -rw-r--r-- | tasks/main.yml | 22 |
1 files changed, 12 insertions, 10 deletions
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 |
