-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare.yml
executable file
·96 lines (86 loc) · 2.56 KB
/
prepare.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/ansible-playbook
---
- import_playbook: playbooks/parse_answers.yml
- name: generate intallation config
hosts: ocp4
gather_facts: no
become: no
tasks:
- delegate_to: localhost
run_once: yes
block:
- name: download installer and client
get_url:
url: "https://mirror.openshift.com/pub/openshift-v4/clients/ocp/{{ answers.ocpversion}}/{{ item.src }}"
dest: "{{ working_dir }}/{{ item.dest }}"
mode: '0644'
loop:
- src: openshift-client-linux-{{ answers.ocpversion }}.tar.gz
dest: openshift-client-linux.tgz
- src: openshift-install-linux-{{ answers.ocpversion }}.tar.gz
dest: openshift-install-linux.tgz
loop_control:
label: "{{ item.src }}"
register: pkg_download
delegate_to: localhost
run_once: yes
tags:
- generate
- name: extract installer and client
shell: tar xvzf '{{ item.dest }}' -C '{{ working_dir }}'
args:
warn: no
when: item is changed
loop: "{{ pkg_download.results }}"
loop_control:
label: "{{ item.dest }}"
delegate_to: localhost
run_once: yes
tags:
- generate
- name: create install config file
template:
src: templates/install-config.j2
dest: "{{ install_config_yaml }}"
tags:
- generate
- name: create ignition-configs
shell: >
{{ openshift_install }} create ignition-configs
--dir={{ working_dir }}
tags:
- generate
- name: publish config to data server
hosts: data_server
gather_facts: no
become: yes
tasks:
- name: download CoreOS images
get_url:
url: "{{ download_url }}/{{ item }}"
dest: "/var/www/html/{{ item }}"
mode: '0644'
loop:
- rhcos-{{ answers.cosversion }}-x86_64-installer-initramfs.img
- rhcos-{{ answers.cosversion }}-x86_64-installer-kernel
- rhcos-{{ answers.cosversion }}-x86_64-metal-bios.raw.gz
tags:
- publish
- name: create directory for ignition files
file:
path: /var/www/html/{{ answers.clusterid }}
state: directory
mode: "0755"
tags:
- publish
- name: publish cluster ignition files
copy:
src: "{{ working_dir }}/{{ item }}"
dest: "/var/www/html/{{ answers.clusterid }}/{{ item }}"
mode: "0644"
loop:
- bootstrap.ign
- master.ign
- worker.ign
tags:
- publish