Skip to content

Commit

Permalink
Merge pull request #8 from expeditioneer/redhat_support
Browse files Browse the repository at this point in the history
added Red Hat support
  • Loading branch information
expeditioneer committed Aug 24, 2023
2 parents 25debf8 + 2b8f33f commit 3ca3c42
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 21 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
on: [push]

jobs:
build:
ci:
strategy:
matrix:
distribution: [AlmaLinux, RedHat]

runs-on: ubuntu-latest
steps:

Expand All @@ -19,7 +23,11 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Create Kickstart config from jinja template
run: |
jinja -d distribution/${{matrix.distribution}}.json ks.cfg.j2 --output ks.cfg
- name: Validate Kickstart file
run: |
ksvalidator --version RHEL8 ks.cfg
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
[![GPL Licence](https://badges.frapsoft.com/os/gpl/gpl.png?v=103)](https://opensource.org/licenses/GPL-3.0/)

This repository contains a Kickstart file to create the necessary base system for a [Foreman](https://www.theforeman.org/) installation with the [Katello](https://theforeman.org/plugins/katello/) plugin.
Also, a Kickstart file the necessary base system for a [RedHat Satellite](https://www.redhat.com/technologies/management/satellite) installation is created.

With this kickstart file an `OEMDRV.iso` is created and attached to the individual releases.
With these kickstart files an ISO is created for each distribution and attached to the individual releases.
This ISO should be present as disc during the installation for a fully automated / unattended installation.
The corresponding ISO must be renamed to **OEMDRV.iso** when attached to the system.

This is tailored to be used when installing Foreman as a Virtual Machine on [libvirt](https://libvirt.org/).
This is tailored to be used when installing Foreman/Satellite as a Virtual Machine on [libvirt](https://libvirt.org/).

For a RedHat installation the DVD ISO is required, it will not work with the minimal / boot ISO.

## System / VM requirements
The VM should have at least _88GiB_ on the `vda` disk.
Expand Down Expand Up @@ -39,7 +43,7 @@ NAMESERVER: 172.16.100.254
IPv6 is disabled on the interface.

### Hostname
The hostname is **foreman.management.internal**
The hostname is either **satellite.management.internal** or **foreman.management.internal**

### NTP Server
Set Timezone is `Europe/Berlin` and the NTP Server is set to `172.16.100.254`.
Expand All @@ -50,7 +54,7 @@ Please change the pre-set passwords as soon as possible. These are only inteded
immediately.

### Password
For the root user the pre-set password is `almalinux`
For the root user the pre-set password is either `almalinux` or `redhat`.

### SSH Key
Remote login for the root user is only allowed with an SSH-Key (prohibit-password) where the details are listed below
Expand All @@ -68,5 +72,12 @@ AAAEBL/pYo4CGMibFrzV2LU5Ka2B2yRtx57uWjSymJ4dh8bvzC1siqNv0h4YvOrJT7EjxZ

_Public Key_ (already present in authorized_keys of user root)
```
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPzC1siqNv0h4YvOrJT7EjxZ1jdLF03hFC/wDYlAO5fZ foreman.management.internal
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPzC1siqNv0h4YvOrJT7EjxZ1jdLF03hFC/wDYlAO5fZ _COMMENT_
```
where _\_COMMENT__ is either `satellite.management.internal` or `foreman.management.internal`.

## Links

Additional documentation and Links can

- [Kickstart commands and options reference](https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/performing_an_advanced_rhel_8_installation/kickstart-commands-and-options-reference_installing-rhel-as-an-experienced-user#addon-com_redhat_kdump_kickstart-commands-for-addons-supplied-with-the-rhel-installation-program)
7 changes: 7 additions & 0 deletions distribution/AlmaLinux.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"hostname": "foreman.management.internal",
"rootpw": "almalinux",
"url": "https://repo.almalinux.org/almalinux/8/BaseOS/x86_64/os/",
"repo": "https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/",
"vgname": "foreman"
}
5 changes: 5 additions & 0 deletions distribution/RedHat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hostname": "satellite.management.internal",
"rootpw": "redhat",
"vgname": "satellite"
}
30 changes: 16 additions & 14 deletions ks.cfg → ks.cfg.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ python36
keyboard --xlayouts='de'
lang en_US.UTF-8

network --bootproto=static --device=enp1s0 --ethtool="autoneg on" --gateway=172.16.100.254 --ip=172.16.100.20 --nameserver=172.16.100.254 --netmask=255.255.255.0 --noipv6 --activate --hostname=foreman.management.internal
network --bootproto=static --device=enp1s0 --ethtool="autoneg on" --gateway=172.16.100.254 --ip=172.16.100.20 --nameserver=172.16.100.254 --netmask=255.255.255.0 --noipv6 --activate --hostname={{ hostname }}

eula --agreed

url --url="https://repo.almalinux.org/almalinux/8/BaseOS/x86_64/os/"
repo --name="AppStream" --baseurl="https://repo.almalinux.org/almalinux/8/AppStream/x86_64/os/"
{% if url is defined %}url --url="{{ url }}"{% endif %}
{% if repo is defined %}repo --name="AppStream" --baseurl="{{ repo }}"{% endif %}

firstboot --disable

Expand All @@ -28,20 +28,22 @@ clearpart --initlabel --all
partition /boot/efi --fstype="efi" --ondisk=vda --size=512 --fsoptions="umask=0077,shortname=winnt"
partition /boot --fstype="xfs" --ondisk=vda --size=1024
partition pv.01 --fstype="lvmpv" --ondisk=vda --grow #--size=86024
volgroup foreman pv.01
logvol / --fstype="xfs" --size=8192 --name=root --vgname=foreman
logvol /home --fstype="xfs" --size=1024 --name=home --vgname=foreman
logvol /var/lib/pgsql --fstype="xfs" --size=20480 --name=var_lib_pgsql --vgname=foreman
logvol /var/lib/pulp --fstype="xfs" --size=51200 --name=var_lib_pulp --vgname=foreman
logvol /var/log --fstype="xfs" --size=1024 --name=var_log --vgname=foreman
logvol /var/log/audit --fstype="xfs" --size=1024 --name=var_log_audit --vgname=foreman
logvol /var/tmp --fstype="xfs" --size=1024 --name=var_tmp --vgname=foreman
logvol swap --fstype="swap" --size=2048 --name=swap --vgname=foreman
volgroup {{ vgname }} pv.01
logvol / --fstype="xfs" --size=8192 --name=root --vgname={{ vgname }}
logvol /home --fstype="xfs" --size=1024 --name=home --vgname={{ vgname }}
logvol /var/lib/pgsql --fstype="xfs" --size=20480 --name=var_lib_pgsql --vgname={{ vgname }}
logvol /var/lib/pulp --fstype="xfs" --size=51200 --name=var_lib_pulp --vgname={{ vgname }}
logvol /var/log --fstype="xfs" --size=1024 --name=var_log --vgname={{ vgname }}
logvol /var/log/audit --fstype="xfs" --size=1024 --name=var_log_audit --vgname={{ vgname }}
logvol /var/tmp --fstype="xfs" --size=1024 --name=var_tmp --vgname={{ vgname }}
logvol swap --fstype="swap" --size=2048 --name=swap --vgname={{ vgname }}

timezone Europe/Berlin --utc --ntpservers=172.16.100.254

rootpw --plaintext almalinux
sshkey --user root "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPzC1siqNv0h4YvOrJT7EjxZ1jdLF03hFC/wDYlAO5fZ foreman.management.internal"
services --enabled=tmp.mount

rootpw --plaintext {{ rootpw }}
sshkey --user root "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPzC1siqNv0h4YvOrJT7EjxZ1jdLF03hFC/wDYlAO5fZ {{ hostname }}"

%addon com_redhat_kdump --disable
%end
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
jinja-cli
pykickstart
requests

0 comments on commit 3ca3c42

Please sign in to comment.