-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-delegate.yml
38 lines (33 loc) · 1.06 KB
/
test-delegate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
- name: Perfom day-2 configuration of Satellite
hosts: satellite
gather_facts: yes
tasks:
- name: Configure libvirt compute resource
block:
- name: Create .ssh directory for foreman user
ansible.builtin.file:
path: /usr/share/foreman/.ssh
owner: foreman
group: foreman
mode: 0600
state: directory
- name: Create ssh-key pair
community.crypto.openssh_keypair:
path: /usr/share/foreman/.ssh/id_rsa
owner: foreman
group: foreman
- name: Get pub file
ansible.builtin.fetch:
src: /usr/share/foreman/.ssh/id_rsa.pub
dest: files/id_rsa.pub
flat: yes
- name: copy key
delegate_to: arsenal.local.lab
ansible.posix.authorized_key:
user: root
state: present
key: "{{ lookup('file', 'files/id_rsa.pub') }}"
- name: Remove key
ansible.builtin.file:
path: files/id_rsa.pub
state: absent