Update file main.yml
This commit is contained in:
parent
3ef24a4233
commit
c140824a61
@ -117,18 +117,20 @@
|
||||
when: ansible_connection != "local"
|
||||
become: yes
|
||||
|
||||
- name: Ensure SSH directory exists
|
||||
# ========== SSH Keys ==========
|
||||
- name: Ensure SSH directory exists for root
|
||||
file:
|
||||
path: /root/.ssh
|
||||
state: directory
|
||||
mode: '0700'
|
||||
become: yes
|
||||
|
||||
- name: Add authorized key for root
|
||||
- name: Add authorized keys for root (exclusive)
|
||||
authorized_key:
|
||||
user: root
|
||||
state: present
|
||||
key: "{{ item }}"
|
||||
exclusive: yes
|
||||
loop: "{{ ssh_public_keys }}"
|
||||
become: yes
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user