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