Skip to content

Commit a121bd8

Browse files
authored
Merge pull request #42037 from jldohmann/OSDOCS-3144
Add coreos-installer pxe customize feature
2 parents c14700c + 2178351 commit a121bd8

8 files changed

+183
-62
lines changed

installing/installing_bare_metal/installing-bare-metal-network-customizations.adoc

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,25 @@ include::modules/installation-user-infra-machines-advanced.adoc[leveloffset=+2]
120120

121121
include::modules/installation-user-infra-machines-advanced-customizing-iso-or-pxe.adoc[leveloffset=+4]
122122

123-
include::modules/installation-user-infra-machines-advanced-customizing-live-iso.adoc[leveloffset=+4]
123+
:boot-media: ISO image
124+
:boot: iso
125+
include::modules/installation-user-infra-machines-advanced-customizing-live.adoc[leveloffset=+4]
124126

125-
include::modules/installation-user-infra-machines-advanced-customizing-live-iso-ca-certs.adoc[leveloffset=+5]
127+
include::modules/installation-user-infra-machines-advanced-customizing-live-ca-certs.adoc[leveloffset=+5]
126128

127-
include::modules/installation-user-infra-machines-advanced-customizing-live-iso-network-config.adoc[leveloffset=+5]
129+
include::modules/installation-user-infra-machines-advanced-customizing-live-network-config.adoc[leveloffset=+5]
130+
:boot-media!:
131+
:boot!:
132+
133+
:boot-media: PXE environment
134+
:boot: pxe
135+
include::modules/installation-user-infra-machines-advanced-customizing-live.adoc[leveloffset=+4]
136+
137+
include::modules/installation-user-infra-machines-advanced-customizing-live-ca-certs.adoc[leveloffset=+5]
138+
139+
include::modules/installation-user-infra-machines-advanced-customizing-live-network-config.adoc[leveloffset=+5]
140+
:boot-media!:
141+
:boot!:
128142

129143
include::modules/installation-user-infra-machines-static-network.adoc[leveloffset=+3]
130144

installing/installing_bare_metal/installing-bare-metal.adoc

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,25 @@ include::modules/installation-user-infra-machines-advanced.adoc[leveloffset=+2]
135135

136136
include::modules/installation-user-infra-machines-advanced-customizing-iso-or-pxe.adoc[leveloffset=+4]
137137

138-
include::modules/installation-user-infra-machines-advanced-customizing-live-iso.adoc[leveloffset=+4]
138+
:boot-media: ISO image
139+
:boot: iso
140+
include::modules/installation-user-infra-machines-advanced-customizing-live.adoc[leveloffset=+4]
139141

140-
include::modules/installation-user-infra-machines-advanced-customizing-live-iso-ca-certs.adoc[leveloffset=+5]
142+
include::modules/installation-user-infra-machines-advanced-customizing-live-ca-certs.adoc[leveloffset=+5]
141143

142-
include::modules/installation-user-infra-machines-advanced-customizing-live-iso-network-config.adoc[leveloffset=+5]
144+
include::modules/installation-user-infra-machines-advanced-customizing-live-network-config.adoc[leveloffset=+5]
145+
:boot-media!:
146+
:boot!:
147+
148+
:boot-media: PXE environment
149+
:boot: pxe
150+
include::modules/installation-user-infra-machines-advanced-customizing-live.adoc[leveloffset=+4]
151+
152+
include::modules/installation-user-infra-machines-advanced-customizing-live-ca-certs.adoc[leveloffset=+5]
153+
154+
include::modules/installation-user-infra-machines-advanced-customizing-live-network-config.adoc[leveloffset=+5]
155+
:boot-media!:
156+
:boot!:
143157

144158
include::modules/installation-user-infra-machines-static-network.adoc[leveloffset=+3]
145159

installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,25 @@ include::modules/installation-user-infra-machines-advanced.adoc[leveloffset=+2]
141141

142142
include::modules/installation-user-infra-machines-advanced-customizing-iso-or-pxe.adoc[leveloffset=+4]
143143

144-
include::modules/installation-user-infra-machines-advanced-customizing-live-iso.adoc[leveloffset=+4]
144+
:boot-media: ISO image
145+
:boot: iso
146+
include::modules/installation-user-infra-machines-advanced-customizing-live.adoc[leveloffset=+4]
145147

146-
include::modules/installation-user-infra-machines-advanced-customizing-live-iso-ca-certs.adoc[leveloffset=+5]
148+
include::modules/installation-user-infra-machines-advanced-customizing-live-ca-certs.adoc[leveloffset=+5]
147149

148-
include::modules/installation-user-infra-machines-advanced-customizing-live-iso-network-config.adoc[leveloffset=+5]
150+
include::modules/installation-user-infra-machines-advanced-customizing-live-network-config.adoc[leveloffset=+5]
151+
:boot-media!:
152+
:boot!:
153+
154+
:boot-media: PXE environment
155+
:boot: pxe
156+
include::modules/installation-user-infra-machines-advanced-customizing-live.adoc[leveloffset=+4]
157+
158+
include::modules/installation-user-infra-machines-advanced-customizing-live-ca-certs.adoc[leveloffset=+5]
159+
160+
include::modules/installation-user-infra-machines-advanced-customizing-live-network-config.adoc[leveloffset=+5]
161+
:boot-media!:
162+
:boot!:
149163

150164
include::modules/installation-user-infra-machines-static-network.adoc[leveloffset=+3]
151165

modules/installation-user-infra-machines-advanced-customizing-live-iso-ca-certs.adoc renamed to modules/installation-user-infra-machines-advanced-customizing-live-ca-certs.adoc

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,37 @@
44
// * installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc
55
// * installing_bare_metal/installing-bare-metal-network-customizations.adoc
66

7-
[id="installation-user-infra-machines-advanced-customizing-live-iso-ca-certs_{context}"]
8-
= Modifying a live install image to use a custom certificate authority
7+
[id="installation-user-infra-machines-advanced-customizing-live-{boot}-ca-certs_{context}"]
8+
= Modifying a live install {boot-media} to use a custom certificate authority
99

1010
You can provide certificate authority (CA) certificates to Ignition with the `--ignition-ca` flag of the `customize` subcommand. You can use the CA certificates during both the installation boot and when provisioning the installed system.
1111

1212
.Procedure
1313

1414
. Download the `coreos-installer` binary from the link:https://mirror.openshift.com/pub/openshift-v4/clients/coreos-installer/latest/[`coreos-installer` image mirror] page.
1515

16+
ifeval::["{boot-media}" == "ISO image"]
1617
. Retrieve the {op-system} ISO image from the link:https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/latest/[{op-system} image mirror] page and run the following command to customize the ISO image for use with a custom CA:
1718
+
1819
[source,terminal]
1920
----
2021
$ coreos-installer iso customize rhcos-<version>-live.x86_64.iso --ignition-ca cert.pem
2122
----
23+
endif::[]
24+
ifeval::["{boot-media}" == "PXE environment"]
25+
. Retrieve the {op-system} `kernel`, `initramfs` and `rootfs` files from the link:https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/latest/[{op-system} image mirror] page and run the following command to create a new customized `initramfs` file for use with a custom CA:
26+
+
27+
[source,terminal]
28+
----
29+
$ coreos-installer pxe customize rhcos-<version>-live-initramfs.x86_64.img \
30+
--ignition-ca cert.pem \
31+
-o rhcos-<version>-custom-initramfs.x86_64.img
32+
----
33+
endif::[]
2234
+
2335
[NOTE]
2436
====
2537
Custom CA certificates affect how Ignition fetches remote resources but they do not affect the certificates installed onto the system.
2638
====
2739
+
28-
Your CA certificate is applied and affects every subsequent boot of the ISO image.
40+
Your CA certificate is applied and affects every subsequent boot of the {boot-media}.

modules/installation-user-infra-machines-advanced-customizing-live-iso.adoc

Lines changed: 0 additions & 37 deletions
This file was deleted.

modules/installation-user-infra-machines-advanced-customizing-live-iso-network-config.adoc renamed to modules/installation-user-infra-machines-advanced-customizing-live-network-config.adoc

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
// * installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc
55
// * installing_bare_metal/installing-bare-metal-network-customizations.adoc
66

7-
[id="installation-user-infra-machines-advanced-customizing-live-iso_network_keyfile_{context}"]
8-
= Modifying a live install image with customized network settings
9-
You can embed a NetworkManager keyfile into the live ISO image and pass it through to the installed system with the `--network-keyfile` flag of the `customize` subcommand.
7+
[id="installation-user-infra-machines-advanced-customizing-live-{boot}_network_keyfile_{context}"]
8+
= Modifying a live install {boot-media} with customized network settings
9+
You can embed a NetworkManager keyfile into the live {boot-media} and pass it through to the installed system with the `--network-keyfile` flag of the `customize` subcommand.
1010

1111
.Procedure
1212

@@ -73,14 +73,29 @@ slave-type=bond
7373
mac-address-blacklist=
7474
----
7575
+
76+
ifeval::["{boot-media}" == "ISO image"]
7677
. Retrieve the {op-system} ISO image from the link:https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/latest/[{op-system} image mirror] page and run the following command to customize the ISO image with your configured networking:
7778
+
7879
[source,terminal]
7980
----
8081
$ coreos-installer iso customize rhcos-<version>-live.x86_64.iso \
81-
--network-keyfile bond0.nmconnection \
82-
--network-keyfile bond0-proxy-em1.nmconnection \
83-
--network-keyfile bond0-proxy-em2.nmconnection
82+
--network-keyfile bond0.nmconnection \
83+
--network-keyfile bond0-proxy-em1.nmconnection \
84+
--network-keyfile bond0-proxy-em2.nmconnection
8485
----
86+
endif::[]
87+
88+
ifeval::["{boot-media}" == "PXE environment"]
89+
. Retrieve the {op-system} `kernel`, `initramfs` and `rootfs` files from the link:https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/latest/[{op-system} image mirror] page and run the following command to create a new customized `initramfs` file that contains your configured networking:
90+
+
91+
[source,terminal]
92+
----
93+
$ coreos-installer pxe customize rhcos-<version>-live-initramfs.x86_64.img \
94+
--network-keyfile bond0.nmconnection \
95+
--network-keyfile bond0-proxy-em1.nmconnection \
96+
--network-keyfile bond0-proxy-em2.nmconnection \
97+
-o rhcos-<version>-custom-initramfs.x86_64.img
98+
----
99+
endif::[]
85100
+
86101
Network settings are applied to the live system and are carried over to the destination system.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
// Module included in the following assemblies
2+
//
3+
// * installing/installing_bare_metal/installing-bare-metal.adoc
4+
// * installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc
5+
// * installing_bare_metal/installing-bare-metal-network-customizations.adoc
6+
7+
[id="installation-user-infra-machines-advanced-customizing-live-{boot}_{context}"]
8+
= Customizing a live {op-system} {boot-media}
9+
You can customize a live {op-system} {boot-media} directly with the
10+
ifeval::["{boot-media}" == "ISO image"]
11+
`coreos-installer iso customize`
12+
endif::[]
13+
ifeval::["{boot-media}" == "PXE environment"]
14+
`coreos-installer pxe customize`
15+
endif::[]
16+
subcommand. When you boot the {boot-media}, the customizations are applied automatically.
17+
18+
You can use this feature to configure the {boot-media} to automatically install {op-system}.
19+
20+
.Procedure
21+
22+
. Download the `coreos-installer` binary from the link:https://mirror.openshift.com/pub/openshift-v4/clients/coreos-installer/latest/[`coreos-installer` image mirror] page.
23+
24+
ifeval::["{boot-media}" == "ISO image"]
25+
. Retrieve the {op-system} ISO image from the link:https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/latest/[{op-system} image mirror] page and the Ignition config file, and then run the following command to inject the Ignition config directly into the ISO image:
26+
+
27+
[source,terminal]
28+
----
29+
$ coreos-installer iso customize rhcos-<version>-live.x86_64.iso \
30+
--dest-ignition bootstrap.ign \ <1>
31+
--dest-device /dev/sda <2>
32+
----
33+
endif::[]
34+
35+
ifeval::["{boot-media}" == "PXE environment"]
36+
. Retrieve the {op-system} `kernel`, `initramfs` and `rootfs` files from the link:https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/latest/[{op-system} image mirror] page and the Ignition config file, and then run the following command to create a new `initramfs` file that contains the customizations from your Ignition config:
37+
+
38+
[source,terminal]
39+
----
40+
$ coreos-installer pxe customize rhcos-<version>-live-initramfs.x86_64.img \
41+
--dest-ignition bootstrap.ign \ <1>
42+
--dest-device /dev/sda \ <2>
43+
-o rhcos-<version>-custom-initramfs.x86_64.img
44+
----
45+
endif::[]
46+
<1> The Ignition config file that is generated from `openshift-installer`.
47+
<2> When you specify this option, the {boot-media} automatically runs an install. Otherwise, the image remains configured for installing, but does not do so automatically unless you specify the `coreos.inst.install_dev` kernel argument.
48+
+
49+
Your customizations are applied and affect every subsequent boot of the {boot-media}.
50+
51+
ifeval::["{boot-media}" == "ISO image"]
52+
. To remove the ISO image customizations and return the image to its pristine state, run:
53+
+
54+
[source,terminal]
55+
----
56+
$ coreos-installer iso reset rhcos-<version>-live.x86_64.iso
57+
----
58+
+
59+
You can now re-customize the live ISO image or use it in its pristine state.
60+
endif::[]

modules/installation-user-infra-machines-static-network.adoc

Lines changed: 36 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ a|Remove the embedded Ignition config from an ISO image.
333333
|*_Option_* |*_Description_*
334334

335335
a|`--dest-ignition <path>`
336-
a|Merge the specified Ignition config into a new configuration fragment for the destination system.
336+
a|Merge the specified Ignition config file into a new configuration fragment for the destination system.
337337

338338
a|`--dest-device <path>`
339339
a|Install and overwrite the specified destination device.
@@ -360,7 +360,7 @@ a|`--installer-config <path>`
360360
a|Apply the specified installer configuration file.
361361

362362
a|`--live-ignition <path>`
363-
a|Merge the specified Ignition config into a new configuration fragment for the live environment.
363+
a|Merge the specified Ignition config file into a new configuration fragment for the live environment.
364364

365365
a|`--live-karg-append <arg>`
366366
a|Add a kernel argument to each boot of the live environment.
@@ -380,29 +380,58 @@ a|Write the ISO to a new output file.
380380
a|`-h`, `--help`
381381
a|Print help information.
382382

383-
2+|*coreos-installer PXE Ignition subcommands*
383+
2+|*coreos-installer PXE subcommands*
384384

385385
|*_Subcommand_* |*_Description_*
386386

387387
2+|Note that not all of these options are accepted by all subcommands.
388388

389+
a|`coreos-installer pxe customize <options> <path>`
390+
a|Customize a {op-system} live PXE boot config.
391+
389392
a|`coreos-installer pxe ignition wrap <options>`
390393
a|Wrap an Ignition config in an image.
391394

392395
a|`coreos-installer pxe ignition unwrap <options> <image_name>`
393396
a|Show the wrapped Ignition config in an image.
394397

395-
2+|*coreos-installer PXE Ignition subcommand options*
398+
2+|*coreos-installer PXE customize subcommand options*
396399

397400
|*_Option_* |*_Description_*
398401

399402
2+|Note that not all of these options are accepted by all subcommands.
400403

401-
a|`-i`, `--ignition-file <path>`
402-
a|The Ignition config to be used. Default is `stdin`.
404+
a|`--dest-ignition <path>`
405+
a|Merge the specified Ignition config file into a new configuration fragment for the destination system.
406+
407+
a|`--dest-device <path>`
408+
a|Install and overwrite the specified destination device.
409+
410+
a|`--network-keyfile <path>`
411+
a|Configure networking by using the specified NetworkManager keyfile for live and destination systems.
412+
413+
a|`--ignition-ca <path>`
414+
a|Specify an additional TLS certificate authority to be trusted by Ignition.
415+
416+
a|`--pre-install <path>`
417+
a|Run the specified script before installation.
418+
419+
a|`post-install <path>`
420+
a|Run the specified script after installation.
421+
422+
a|`--installer-config <path>`
423+
a|Apply the specified installer configuration file.
424+
425+
a|`--live-ignition <path>`
426+
a|Merge the specified Ignition config file into a new configuration fragment for the live environment.
403427

404428
a|`-o,` `--output <path>`
405-
a|Write the ISO to a new output file.
429+
a|Write the initramfs to a new output file.
430+
431+
[NOTE]
432+
====
433+
This option is required for PXE environments.
434+
====
406435

407436
a|`-h`, `--help`
408437
a|Print help information.

0 commit comments

Comments
 (0)