-
Notifications
You must be signed in to change notification settings - Fork 39
/
02_sno_setup_working_directory.yml
35 lines (31 loc) · 1.07 KB
/
02_sno_setup_working_directory.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
---
- name: This play installs needed tools to provision infrastructure VMs
hosts: vm_host
vars_files:
- sno_vars.yml
tasks:
- name: Set home directory as fact for the user
ansible.builtin.set_fact:
home_dir: "{{ ansible_env.HOME }}"
- name: Creating workspace
ansible.builtin.file:
state: directory
path: "{{ workspace_directory.base_path }}/{{ cluster.name }}"
recurse: true
- name: Copy terraform files on host
ansible.builtin.copy:
src: "{{ playbook_dir }}/terraform"
dest: "{{ workspace_directory.base_path }}/{{ cluster.name }}/"
mode: "0755"
- name: Create ssh keypair
community.crypto.openssh_keypair:
path: "{{ playbook_dir }}/id_rsa_ocp_setup"
delegate_to: localhost
- name: Copy SSH keys in working directory
ansible.builtin.copy:
src: "{{ playbook_dir }}/{{ item }}"
dest: "{{ workspace_directory.base_path }}/{{ cluster.name }}/{{ item }}"
mode: "0755"
loop:
- id_rsa_ocp_setup
- id_rsa_ocp_setup.pub