Update file main.yml

This commit is contained in:
Administrator 2026-03-24 12:39:42 +05:00
parent 3ef24a4233
commit c140824a61

View File

@ -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