Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ansible_lza_create_rhel_iso
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
ansible_lza_create_rhel_iso
Commits
edf63ad1
Commit
edf63ad1
authored
4 years ago
by
Jörg Sachse
Browse files
Options
Downloads
Patches
Plain Diff
doc: add documentation to clarify context
parent
323d21a1
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
README.md
+2
-2
2 additions, 2 deletions
README.md
site.yml
+0
-2
0 additions, 2 deletions
site.yml
tasks/main.yml
+16
-2
16 additions, 2 deletions
tasks/main.yml
templates/isolinux.cfg.j2
+1
-1
1 addition, 1 deletion
templates/isolinux.cfg.j2
vars/main.yml
+4
-0
4 additions, 0 deletions
vars/main.yml
with
23 additions
and
7 deletions
README.md
+
2
−
2
View file @
edf63ad1
...
@@ -16,10 +16,10 @@ To deploy this role to a managed host, the following software must be installed
...
@@ -16,10 +16,10 @@ To deploy this role to a managed host, the following software must be installed
## Quick start
## Quick start
```
```
ansible-playbook site.yml -
b -K
ansible-playbook site.yml -
i ~/inventory_tmp.yml --become
```
```
## General usage
## General
Ansible
usage
Most options already have sensible defaults in
`ansible.cfg`
. However, you can override these defaults using CLI options/flags if you want to.
Most options already have sensible defaults in
`ansible.cfg`
. However, you can override these defaults using CLI options/flags if you want to.
...
...
This diff is collapsed.
Click to expand it.
site.yml
+
0
−
2
View file @
edf63ad1
---
---
-
hosts
:
localhost
-
hosts
:
localhost
connection
:
local
connection
:
local
vars
:
-
ISO
:
"
RHEL79"
vars_prompt
:
vars_prompt
:
-
name
:
install_hostname
-
name
:
install_hostname
prompt
:
"
What's
the
hostname
of
the
system
that
you're
trying
to
install?
Use
ONLY
the
hostname,
NOT
the
FQDN!"
prompt
:
"
What's
the
hostname
of
the
system
that
you're
trying
to
install?
Use
ONLY
the
hostname,
NOT
the
FQDN!"
...
...
This diff is collapsed.
Click to expand it.
tasks/main.yml
+
16
−
2
View file @
edf63ad1
---
---
### PREPARATION
### PREPARATION
# Create a separate build directory so the role directory is not overly polluted
-
name
:
create build directory
-
name
:
create build directory
file
:
file
:
path
:
"
{{
playbook_dir
}}/build/"
path
:
"
{{
playbook_dir
}}/build/"
state
:
directory
state
:
directory
# Mount the RHEL ISO image to a temporary mountpoint. That mountpoint is
# automatically removed on unmount.
# To not pollute the system's fstab file, we use a separate on below /tmp/.
-
name
:
mount boot ISO
-
name
:
mount boot ISO
mount
:
mount
:
fstype
:
"
iso9660"
fstype
:
"
iso9660"
opts
:
"
loop"
opts
:
"
loop"
path
:
"
{{
playbook_dir
}}/iso/"
path
:
"
{{
playbook_dir
}}/iso/"
src
:
"
{{
playbook_dir
}}/rhel-server-
7.9
-x86_64-dvd.iso"
src
:
"
{{
playbook_dir
}}/rhel-server-
{{
rhel_version_long
}}
-x86_64-dvd.iso"
fstab
:
"
/tmp/fstab"
fstab
:
"
/tmp/fstab"
state
:
mounted
state
:
mounted
# Copy contents of ISO image to the build directory, because they will need to
# be included in the new image.
-
name
:
copy ISO contents
-
name
:
copy ISO contents
shell
:
shell
:
cmd
:
'
cp
-avRf
"{{
playbook_dir
}}/iso"
"{{
playbook_dir
}}/build"'
cmd
:
'
cp
-avRf
"{{
playbook_dir
}}/iso"
"{{
playbook_dir
}}/build"'
...
@@ -31,11 +37,17 @@
...
@@ -31,11 +37,17 @@
### CREATE CONFIGS
### CREATE CONFIGS
# Write Kickstart files for all servers listed in the network.yml vars file.
# The Kickstart file contains configurations for the RHEL Anaconda installer
# that determine what the future system will look like in terms of packages,
# partitioning, network configuration etc.
-
name
:
write Kickstart files
-
name
:
write Kickstart files
template
:
template
:
src
:
"
kickstart.cfg.j2"
src
:
"
kickstart.cfg.j2"
dest
:
"
build/iso/{{
item.hostname
}}.cfg"
dest
:
"
build/iso/{{
item.hostname
}}.cfg"
loop
:
"
{{
hosts
}}"
loop
:
"
{{
hosts
}}"
# Write isolinux config file that contains references to the installation media
# and the Kickstart file.
-
name
:
template isolinux config
-
name
:
template isolinux config
template
:
template
:
src
:
"
isolinux.cfg.j2"
src
:
"
isolinux.cfg.j2"
...
@@ -45,6 +57,8 @@
...
@@ -45,6 +57,8 @@
### CREATE ISO INSTALLATION IMAGE
### CREATE ISO INSTALLATION IMAGE
# Create the custom ISO installation DVD image. When it's finished, it can be
# found below "./build/".
-
name
:
create ISO image
-
name
:
create ISO image
command
:
command
:
cmd
:
'
xorrisofs
-output
{{
playbook_dir
}}/build/{{
ISO
}}.iso
-eltorito-boot
isolinux/isolinux.bin
-c
isolinux/boot.cat
-no-emul-boot
-boot-load-size
4
-boot-info-table
-volid
"{{
ISO
}}"
-rational-rock
{{
playbook_dir
}}/build/iso/'
cmd
:
'
xorrisofs
-output
{{
playbook_dir
}}/build/{{
ISO
}}.iso
-eltorito-boot
isolinux/isolinux.bin
-c
isolinux/boot.cat
-no-emul-boot
-boot-load-size
4
-boot-info-table
-volid
"{{
ISO
}}"
-rational-rock
{{
playbook_dir
}}/build/iso/'
...
@@ -58,7 +72,7 @@
...
@@ -58,7 +72,7 @@
mount
:
mount
:
path
:
"
{{
playbook_dir
}}/iso"
path
:
"
{{
playbook_dir
}}/iso"
state
:
unmounted
state
:
unmounted
-
name
:
clean up
-
name
:
clean up
temporary files and directories
file
:
file
:
path
:
"
{{
item
}}"
path
:
"
{{
item
}}"
state
:
absent
state
:
absent
...
...
This diff is collapsed.
Click to expand it.
templates/isolinux.cfg.j2
+
1
−
1
View file @
edf63ad1
...
@@ -60,7 +60,7 @@ menu separator # insert an empty line
...
@@ -60,7 +60,7 @@ menu separator # insert an empty line
##### Begin INSERTED FOR ANSIBLE ROLE #####
##### Begin INSERTED FOR ANSIBLE ROLE #####
label netinstall
label netinstall
menu label Install Red Hat Enterprise Linux
7.9
^Netinstall Server
menu label Install Red Hat Enterprise Linux
{{ rhel_version_long }}
^Netinstall Server
menu default
menu default
kernel vmlinuz
kernel vmlinuz
append initrd=initrd.img inst.ks=cdrom:/{{ item.hostname }}.cfg inst.stage2=hd:LABEL=RHEL79 quiet
append initrd=initrd.img inst.ks=cdrom:/{{ item.hostname }}.cfg inst.stage2=hd:LABEL=RHEL79 quiet
...
...
This diff is collapsed.
Click to expand it.
vars/main.yml
+
4
−
0
View file @
edf63ad1
---
---
# vars file for ansible_lza_create_rhel_iso
# vars file for ansible_lza_create_rhel_iso
rhel_version_long
:
"
7.9"
rhel_version_short
:
"
79"
ISO
:
"
RHEL{{
rhel_version_short
}}"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment