add ssh_updateKey
This commit is contained in:
13
ssh_updateKey.yml
Normal file
13
ssh_updateKey.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
# https://docs.ansible.com/ansible/latest/collections/ansible/posix/authorized_key_module.html#examples
|
||||||
|
- name: update apt-cache and upgrade
|
||||||
|
hosts: oracleServer
|
||||||
|
tasks:
|
||||||
|
- name: upgrade packages
|
||||||
|
become: true
|
||||||
|
ansible.posix.authorized_key:
|
||||||
|
user: "{{ ansible_user_id }}"
|
||||||
|
exclusive: true
|
||||||
|
state: present
|
||||||
|
key: "{{ lookup('file', '~/.ssh/id_ed25519.pub') }}"
|
||||||
|
|
||||||
Reference in New Issue
Block a user