23 lines
500 B
YAML
23 lines
500 B
YAML
---
|
|
- 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: test_server
|
|
gather_facts: true
|
|
become: false
|
|
|
|
tasks:
|
|
- name: Run hostname -a
|
|
command: hostname -a
|
|
register: hostname_out
|
|
|
|
- name: Show hostname output
|
|
debug:
|
|
var: hostname_out.stdout |