add ssh key

This commit is contained in:
Benedikt Penner
2026-03-15 00:58:57 +01:00
parent 8d4cd6b3ad
commit 0ac3dc09c4
4 changed files with 19 additions and 2 deletions

View File

@@ -1,6 +1,15 @@
---
- name: deploy key
hosts: bastion
gather_facts: false
tasks:
- name: Set authorized key taken from file
ansible.posix.authorized_key:
user: clusteruser
state: present
key: "{{ lookup('file', './files/ansible_key.pub') }}"
- hosts: bastion
- hosts: test_server
gather_facts: true
become: false