Skip to content

Commit

Permalink
Update to Foreman 3.5 and Katello 4.7
Browse files Browse the repository at this point in the history
* Restructure to use Katello as base
* Update plugins
* Update screenshots and graphics
  • Loading branch information
dgoetz committed May 9, 2023
1 parent f6c8db5 commit 299cdc6
Show file tree
Hide file tree
Showing 91 changed files with 2,254 additions and 1,709 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ In addition to the sources you can find the rendered material on
[netways.github.io](https://netways.github.io/foreman-training)

* [Presentation](https://netways.github.io/foreman-training)
* [Handouts](https://github.com/NETWAYS/foreman-training/releases/download/v1.6/foreman-training-handouts.pdf)
* [Exercises](https://github.com/NETWAYS/foreman-training/releases/download/v1.6/foreman-training-exercises.pdf)
* [Solutions](https://github.com/NETWAYS/foreman-training/releases/download/v1.6/foreman-training-solutions.pdf)
* [Handouts](https://github.com/NETWAYS/foreman-training/releases/download/v1.7/foreman-training-handouts.pdf)
* [Exercises](https://github.com/NETWAYS/foreman-training/releases/download/v1.7/foreman-training-exercises.pdf)
* [Solutions](https://github.com/NETWAYS/foreman-training/releases/download/v1.7/foreman-training-solutions.pdf)

## Provide your own training

Expand Down
9 changes: 4 additions & 5 deletions Setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@

## Virtual machine foreman.localdomain

To setup a new version of the virtual machine install CentOS 8 from ISO, only configuration required is
To setup a new version of the virtual machine install CentOS Stream 8 from ISO, only configuration required is
setting the network interface to manual, ip address 10.0.0.2, netmask 255.255.0.0, gateway 10.0.0.1,
dns 10.0.0.1.

Afterwards run the finish.sh provided in the _files directory to setup host entries and openldap.

## Virtual machine monitoring.localdomain

To setup a new version of the virtual machine install CentOS 8 from ISO, only configuration required is
To setup a new version of the virtual machine install Ubuntu 22.04 Server from ISO, only configuration required is
setting the network interface to manual, ip address 10.0.0.3, netmask 255.255.0.0, gateway 10.0.0.1,
dns 10.0.0.1.
dns 10.0.0.1 and creating a user training with the default password.

Afterwards copy the files from _files/monitoring into /root/ and run the finish.sh to setup host including
Icinga 2, Icinga Web 2 and Director with preparations for the exercise.
Afterwards run the finish.sh to setup host including Icinga 2, Icinga Web 2 and Director with preparations for the exercise.

## Local mirror

Expand Down
14 changes: 5 additions & 9 deletions _files/share/modules/training/manifests/user.pp
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
class training::user (
$id,
$ssh_pub_key,
$ssh_key_type = "ssh-rsa",
$sudo = false
String $id,
String $ssh_pub_key,
Enum[ 'ssh-dss', 'dsa', 'ssh-rsa', 'rsa', 'ecdsa-sha2-nistp256', 'ecdsa-sha2-nistp384', 'ecdsa-sha2-nistp521', 'ssh-ed25519', 'ed25519' ] $ssh_key_type = 'ssh-rsa',
Boolean $sudo = false
) {
validate_string($id)
validate_string($ssh_pub_key)
validate_re($ssh_key_type, [ '^ssh-dss$', '^dsa$', '^ssh-rsa$', '^rsa$', '^ecdsa-sha2-nistp256$', '^ecdsa-sha2-nistp384$', '^ecdsa-sha2-nistp521$', '^ssh-ed25519$', '^ed25519$' ])
validate_bool($sudo)

user { $id:
ensure => present,
managehome => true,
Expand All @@ -30,3 +25,4 @@
}
}
}

42 changes: 34 additions & 8 deletions _files/share/monitoring/finish.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,35 @@
#!/bin/bash
yum install epel-release -y
yum install http://yum.puppetlabs.com/puppet6/puppet6-release-el-8.noarch.rpm -y
yum install puppet-agent -y
/opt/puppetlabs/bin/puppet module install puppetlabs-apache
/opt/puppetlabs/bin/puppet module install puppetlabs-mysql
/opt/puppetlabs/bin/puppet module install icinga-icinga2
/opt/puppetlabs/bin/puppet module install icinga-icingaweb2
/opt/puppetlabs/bin/puppet apply -v monitoring.localdomain.pp
wget -O - https://packages.netways.de/netways-repo.asc | sudo apt-key add -
echo "deb https://packages.netways.de/extras/ubuntu jammy main" | sudo tee /etc/apt/sources.list.d/netways-extras-release.list
wget -O - https://apt.puppetlabs.com/DEB-GPG-KEY-puppet-20250406 | sudo apt-key add -
echo "deb http://apt.puppetlabs.com jammy puppet7" | sudo tee /etc/apt/sources.list.d/puppet7.list
apt update
apt install -y icinga-installer

echo '10.0.0.1 host.localdomain
10.0.0.2 foreman.localdomain
10.0.0.3 monitoring.localdomain' >> /etc/hosts

icinga-installer -S server-db-mysql --initial-admin-username icinga --initial-admin-password icinga

usermod -a -G nagios training

sed -i "s@RewriteBase /icingaweb2/@RewriteBase /icingaweb2/\n\tRewriteCond %{REMOTE_ADDR} ^10\.0\.0\.2\n\tRewriteRule ^(.*)$ - [E=REMOTE_USER:foreman]@" /etc/apache2/conf.d/icingaweb2.conf
systemctl restart apache2

echo 'object ApiUser "foreman" {
password = "foreman"
permissions = [ "*" ]
}' >> /etc/icinga2/zones.d/main/api-users.conf
systemctl restart icinga2

echo '[External]
backend = "external"' >> /etc/icingaweb2/authentication.ini
echo '[Foreman]
users = "foreman"
permissions = "module/director, director/api, director/*"' >> /etc/icingaweb2/roles.ini

icingacli director host create foreman_host --object_type template --check_command hostalive
icingacli director service create ssh-linux --object_type template --check_command ssh
icingacli director service create ssh --object_type apply --imports ssh-linux --assign_filter "host.vars.osfamily=%22Redhat%22 || host.vars.osfamily=%22Debian%22"
icingacli director config deploy
27 changes: 0 additions & 27 deletions _files/share/monitoring/icingaweb2.conf

This file was deleted.

254 changes: 0 additions & 254 deletions _files/share/monitoring/monitoring.localdomain.pp

This file was deleted.

Loading

0 comments on commit 299cdc6

Please sign in to comment.