Skip to content
Snippets Groups Projects
Commit edf63ad1 authored by Jörg Sachse's avatar Jörg Sachse
Browse files

doc: add documentation to clarify context

parent 323d21a1
No related branches found
No related tags found
No related merge requests found
......@@ -16,10 +16,10 @@ To deploy this role to a managed host, the following software must be installed
## 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.
......
---
- hosts: localhost
connection: local
vars:
- ISO: "RHEL79"
vars_prompt:
- name: install_hostname
prompt: "What's the hostname of the system that you're trying to install? Use ONLY the hostname, NOT the FQDN!"
......
---
### PREPARATION
# Create a separate build directory so the role directory is not overly polluted
- name: create build directory
file:
path: "{{ playbook_dir }}/build/"
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
mount:
fstype: "iso9660"
opts: "loop"
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"
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
shell:
cmd: 'cp -avRf "{{ playbook_dir }}/iso" "{{ playbook_dir }}/build"'
......@@ -31,11 +37,17 @@
### 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
template:
src: "kickstart.cfg.j2"
dest: "build/iso/{{ item.hostname }}.cfg"
loop: "{{ hosts }}"
# Write isolinux config file that contains references to the installation media
# and the Kickstart file.
- name: template isolinux config
template:
src: "isolinux.cfg.j2"
......@@ -45,6 +57,8 @@
### 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
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/'
......@@ -58,7 +72,7 @@
mount:
path: "{{ playbook_dir }}/iso"
state: unmounted
- name: clean up
- name: clean up temporary files and directories
file:
path: "{{ item }}"
state: absent
......
......@@ -60,7 +60,7 @@ menu separator # insert an empty line
##### Begin INSERTED FOR ANSIBLE ROLE #####
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
kernel vmlinuz
append initrd=initrd.img inst.ks=cdrom:/{{ item.hostname }}.cfg inst.stage2=hd:LABEL=RHEL79 quiet
......
---
# vars file for ansible_lza_create_rhel_iso
rhel_version_long: "7.9"
rhel_version_short: "79"
ISO: "RHEL{{ rhel_version_short }}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment