Added bootstrap role with the tasks, defaults and handlers necessary for the playbooks
This commit is contained in:
19
roles/bootstrap/tasks/auth@ssh.yml
Normal file
19
roles/bootstrap/tasks/auth@ssh.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
- name: Add authorized keys for SSH access to accounts
|
||||
ansible.posix.authorized_keys:
|
||||
user: "{{ item[0] }}"
|
||||
key: "{{ item[1] }}"
|
||||
state: present
|
||||
validate_certs: no
|
||||
loop: "{{ pubkeys }}"
|
||||
register: pubkeys_assigned
|
||||
tags: ['default', 'assign_pubkeys']
|
||||
- name: Disable SSH password authentication
|
||||
copy:
|
||||
src: sshd/nopass.conf
|
||||
dest: /etc/ssh/sshd_config.d/nopass.conf
|
||||
owner: "{{ root_acct }}"
|
||||
group: "{{ root_acct }}"
|
||||
force: yes
|
||||
register: ssh_passauth_disabled
|
||||
tags: ['default', 'disable_ssh_passauth']
|
Reference in New Issue
Block a user