fix(users.yml): replace deprecated 'authorized_key' with 'ansible.posix.authorized_key' for improved compatibility
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
- users-exists
|
||||
|
||||
- name: (users.yml) Ensure authorized_key files for default users are present
|
||||
authorized_key:
|
||||
ansible.posix.authorized_key:
|
||||
user: "{{ item.0.name }}"
|
||||
key: "{{ item.1 }}"
|
||||
state: present
|
||||
@@ -106,7 +106,7 @@
|
||||
- users-exists
|
||||
|
||||
- name: (users.yml) Ensure authorized_key files for extra users are present
|
||||
authorized_key:
|
||||
ansible.posix.authorized_key:
|
||||
user: "{{ item.0.name }}"
|
||||
key: "{{ item.1 }}"
|
||||
state: present
|
||||
@@ -120,7 +120,7 @@
|
||||
- authorized_key
|
||||
|
||||
- name: (users.yml) other entries authorized_key files
|
||||
authorized_key:
|
||||
ansible.posix.authorized_key:
|
||||
user: "{{ item.user }}"
|
||||
key: "{{ item.key }}"
|
||||
state: present
|
||||
@@ -229,6 +229,9 @@
|
||||
ansible.builtin.file:
|
||||
path: /root/.ssh
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: "0700"
|
||||
|
||||
- name: (users.yml) Copy (backup) ed25519 ssh private key to user root
|
||||
ansible.builtin.copy:
|
||||
@@ -265,7 +268,7 @@
|
||||
- insert_ssh_keypair_backup_server
|
||||
|
||||
- name: (users.yml) Ensure authorized_key (root) on backup hosts contains public key
|
||||
authorized_key:
|
||||
ansible.posix.authorized_key:
|
||||
user: root
|
||||
key: "{{ lookup('file', item.pub_key_src) }}"
|
||||
state: present
|
||||
|
||||
Reference in New Issue
Block a user