2026-03-14 20:43:35 +01:00
|
|
|
---
|
2026-03-15 00:58:57 +01:00
|
|
|
- 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') }}"
|
2026-03-14 20:43:35 +01:00
|
|
|
|
2026-03-15 00:58:57 +01:00
|
|
|
- hosts: test_server
|
2026-03-14 20:43:35 +01:00
|
|
|
gather_facts: true
|
|
|
|
|
become: false
|
|
|
|
|
|
|
|
|
|
tasks:
|
2026-03-14 21:52:37 +01:00
|
|
|
- name: Run hostname -a
|
|
|
|
|
command: hostname -a
|
|
|
|
|
register: hostname_out
|
2026-03-14 20:43:35 +01:00
|
|
|
|
2026-03-14 21:52:37 +01:00
|
|
|
- name: Show hostname output
|
|
|
|
|
debug:
|
|
|
|
|
var: hostname_out.stdout
|