forked from chuckersjp/coreos-iso-maker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplaybook-single.yml
82 lines (67 loc) · 1.84 KB
/
playbook-single.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
---
- name: Playbook to recreate the RHCOS ISO for static IP
hosts: localhost
gather_facts: false
tasks:
- block:
- name: Get the original ISO
get_url:
url: https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/{{ ocp_version }}/latest/{{ iso_name }}
dest: /tmp
checksum: sha256:{{ iso_checksum }}
- name: Mount ISO
mount:
src: /tmp/{{ iso_name }}
path: /mnt/iso
fstype: iso9660
opts: ro,noauto
state: mounted
become: true
- name: Copy contents of iso
synchronize:
src: /mnt/iso/
dest: /tmp/rhcos-iso/
- name: Generate the menu list
hosts: all
order: sorted
gather_facts: false
tasks:
- name: Relace the isolinux.cfg file
template:
src: isolinux.cfg-single.j2
dest: /tmp/rhcos-iso/isolinux/isolinux.cfg
delegate_to: localhost
- name: Make the single ISO
hosts: localhost
gather_facts: false
tasks:
- name: Ensure mkisofs is installed
yum:
name: genisoimage
become: true
delegate_to: localhost
- name: Create new ISO image
command: >
/usr/bin/mkisofs -U -A 'RHCOS-x86_64' -V 'RHCOS-x86_64' -volset 'RHCOS-x86_64' -J -joliet-long -r -v -T
-x ./lost+found -o /tmp/rhcos_install-{{ inventory_hostname_short}}.iso -b isolinux/isolinux.bin
-c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img
-no-emul-boot .
args:
chdir: /tmp/rhcos-iso/
become: true
delegate_to: localhost
- name: Cleanup tasks
hosts: localhost
gather_facts: false
tasks:
- block:
- name: Unmount ISO
mount:
path: /mnt/iso
state: absent
- name: Remove ISO copy
file:
path: /tmp/rhcos-iso
state: absent
become: true
...