Skip to content

Commit 2a4b7ab

Browse files
committed
Update to Foreman 3.13 and Katello 4.15
* Add Pull mode to Remote Execution * Add Leapp plugin * Deactive Monitoring plugin for now
1 parent 1542a13 commit 2a4b7ab

29 files changed

Lines changed: 766 additions & 507 deletions

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ In addition to the sources you can find the rendered material on
1818
[netways.github.io](https://netways.github.io/foreman-training)
1919

2020
* [Presentation](https://netways.github.io/foreman-training)
21-
* [Handouts](https://github.com/NETWAYS/foreman-training/releases/download/v1.8/foreman-training-handouts.pdf)
22-
* [Exercises](https://github.com/NETWAYS/foreman-training/releases/download/v1.8/foreman-training-exercises.pdf)
23-
* [Solutions](https://github.com/NETWAYS/foreman-training/releases/download/v1.8/foreman-training-solutions.pdf)
21+
* [Handouts](https://github.com/NETWAYS/foreman-training/releases/download/v1.9/foreman-training-handouts.pdf)
22+
* [Exercises](https://github.com/NETWAYS/foreman-training/releases/download/v1.9/foreman-training-exercises.pdf)
23+
* [Solutions](https://github.com/NETWAYS/foreman-training/releases/download/v1.9/foreman-training-solutions.pdf)
2424

2525
## Provide your own training
2626

Setup.md

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,53 @@
22

33
## Virtual machine foreman.localdomain
44

5-
To setup a new version of the virtual machine install CentOS Stream 8 from ISO, only configuration required is
5+
To setup a new version of the virtual machine install CentOS Stream 9 from ISO, only configuration required is
66
setting the network interface to manual, ip address 10.0.0.2, netmask 255.255.0.0, gateway 10.0.0.1,
7-
dns 10.0.0.1.
7+
dns 10.0.0.1. In addition you may want to allow SSH access for root.
88

9-
Afterwards run the finish.sh provided in the _files directory to setup host entries and openldap.
9+
Afterwards run the Ansible playbook provided in the _files directory to setup host entries and openldap.
1010

1111
## Virtual machine monitoring.localdomain
1212

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

17-
Afterwards run the finish.sh to setup host including Icinga 2, Icinga Web 2 and Director with preparations for the exercise.
17+
Afterwards run the Ansible playbook provided in the _files directory to setup host including Icinga 2, Icinga Web 2 and Director with preparations for the exercise.
1818

1919
## Local mirror
2020

21-
A Vagrant file is provided in the directory to setup a local mirror of CentOS 8 x86_64, EPEL 8 x86_64
22-
Puppet EPEL 8 x86_64, Foreman EPEL 8 x86_64 and the Discovery Image. This machine will require about
23-
25GB.
21+
To provide a local mirror use a Katello instance like needed for the Katello Demo.
22+
In addition to RPM and DEB repositories you will need some files like the Ubuntu isos and Discovery image which you can drop in the /pub directory.
23+
As most repositories stopped providing rsync, this is the best solution. Some limitations like Katello not supporting the debian installer and the need to publish unprotected do apply of course.
24+
You can also use on-demand downloading to save space, just run all the exercises once against the mirror.
2425

2526
## Katello Demo
2627

2728
To setup the Katello demo follow this guide (it requires vagrant and ansible to be installed):
2829

2930
# git clone https://github.com/Katello/forklift.git
3031
# cd forklift
31-
# vagrant up centos7-katello-3.10
32+
# vagrant up centos9-stream-katello-4.15
3233

3334
This will setup your Katello server, login with the provided credentials and add the following content:
3435

35-
* GPG Key "RPM-GPG-KEY-CentOS-7" by uploading the key from a CentOS 7 system
36-
* Product "CentOS7" with the key assigned
37-
* Repository "CentOS7-Base-x86_64" of type "yum" and URL "http://mirror.centos.org/centos/7/os/x86_64/"
38-
* Sync this repository - it will consume about 7GB (or choose "On Demand" to save some storage)
36+
* GPG Key "RPM-GPG-KEY-centosofficial" by uploading the key from a CentOS Stream system
37+
* Product "CentOS" with the key assigned
38+
* Repository "CentOS-Stream-9-Base-x86_64" of type "yum" and URL "https://mirror.stream.centos.org/9-stream/BaseOS/x86_64/os/"
39+
* Repository "CentOS-Stream-9-Appstream-x86_64" of type "yum" and URL "https://mirror.stream.centos.org/9-stream/Appstream/x86_64/os/"
40+
* Sync this repository - it will consume about 10GB (or choose "On Demand" to save some storage)
3941
* Life Cycle Environment "Test" and "Production"
40-
* Content View "CentOS7"
41-
* Add the Repository "CentOS7-Base-x86_64"
42+
* Content View "CentOS"
43+
* Add the Repositories "CentOS-Stream-9-Base-x86_64" and "CentOS-Stream-9-Appstream-x86_64"
4244
* Publish new version
4345
* Promote "Version 1.0" to Life Cycle Environment "Test"
44-
* Activation Key "CentOS7-Test"
45-
* Assigned to Life Cycle Environment "Test" and Content View "CentOS7"
46-
* Subscription to Repository "CentOS7-Base-x86_64"
46+
* Activation Key "CentOS Stream 9 - Test"
47+
* Assigned to Life Cycle Environment "Test" and Content View "CentOS"
48+
* Enable the Repositories
4749

48-
Register the system to itself:
50+
Register the system to itself (typically not recommended) or use another system (depending on your setup) using the command provided by the UI.
4951

50-
# vagrant ssh centos7-katello-3.10
51-
# yum -y install katello-agent http://$(hostname -f)/pub/katello-ca-consumer-latest.noarch.rpm
52-
# subscription-manager register --org Default_Organization --activationkey="CentOS7-Test"
52+
If you own a Red Hat Developer Subscription, it is also possible to create a Manifest and show the Red Hat specific parts.
5353

54-
If you own a Red Hat Developer Subscription, it is also possible to create a Manifest and show the Red Hat
55-
specific parts.
56-
57-
If you own a SUSE Subscription, you can install "tfm-rubygem-foreman_scc_manager" to show the SLES specific
58-
parts. At the moment it requires you to install the nightly package because 3.10 does not include plugin
59-
version 1.6.0 or higher.
54+
If you own a SUSE Subscription, you can install "tfm-rubygem-foreman_scc_manager" to show the SLES specific parts.

Vagrantfile

Lines changed: 0 additions & 54 deletions
This file was deleted.
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
---
2+
- name: Prepare Foreman Setup
3+
hosts: foreman.localdomain
4+
become: true
5+
gather_facts: true
6+
tasks:
7+
- name: Ensure hostname is set
8+
ansible.builtin.hostname:
9+
name: foreman
10+
use: systemd
11+
12+
- name: Ensure host entries
13+
ansible.builtin.blockinfile:
14+
path: /etc/hosts
15+
append_newline: true
16+
prepend_newline: true
17+
block: |
18+
10.0.0.1 host.localdomain host
19+
10.0.0.2 foreman.localdomain foreman
20+
10.0.0.3 monitoring.localdomain monitoring
21+
22+
- name: Install epel-release
23+
ansible.builtin.dnf:
24+
name: epel-release
25+
state: installed
26+
27+
- name: Disable repository {{ item }}
28+
ansible.builtin.ini_file:
29+
path: "/etc/yum.repos.d/{{ item }}.repo"
30+
section: "{{ item }}"
31+
option: enabled
32+
value: 0
33+
loop:
34+
- epel
35+
- epel-next
36+
- epel-cisco-openh264
37+
38+
- name: Install OpenLDAP server
39+
ansible.builtin.dnf:
40+
name:
41+
- openldap-servers
42+
- openldap-clients
43+
- python3-ldap
44+
state: installed
45+
enablerepo: epel
46+
47+
- name: Start OpenLDAP server
48+
ansible.builtin.service:
49+
name: slapd
50+
state: started
51+
enabled: true
52+
53+
- name: OpenLDAP - Define Suffix
54+
community.general.ldap_attrs:
55+
dn: olcDatabase={2}mdb,cn=config
56+
attributes:
57+
olcSuffix: dc=localdomain
58+
state: exact
59+
60+
- name: OpenLDAP - Set up admin
61+
community.general.ldap_attrs:
62+
dn: olcDatabase={2}mdb,cn=config
63+
attributes:
64+
olcRootDN: "{{ ldap_user }}"
65+
olcRootPW: "{{ ldap_password_encrypted }}"
66+
state: exact
67+
68+
- name: OpenLDAP - Check for schema cosine
69+
ansible.builtin.command: ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=schema,cn=config -s one '(cn={*}cosine)' dn
70+
changed_when: false
71+
register: schema_cosine_loaded
72+
73+
- name: OpenLDAP - Load schema cosine
74+
ansible.builtin.command: ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/cosine.ldif
75+
when: not schema_cosine_loaded.stdout
76+
77+
- name: OpenLDAP - Check for schema inetorgperson
78+
ansible.builtin.command: ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=schema,cn=config -s one '(cn={*}inetorgperson)' dn
79+
changed_when: false
80+
register: schema_inetorgperson_loaded
81+
82+
- name: OpenLDAP - Load schema inetorgperson
83+
ansible.builtin.command: ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/inetorgperson.ldif
84+
when: not schema_inetorgperson_loaded.stdout
85+
86+
- name: OpenLDAP - Check for schema nis
87+
ansible.builtin.command: ldapsearch -Q -LLL -Y EXTERNAL -H ldapi:/// -b cn=schema,cn=config -s one '(cn={*}nis)' dn
88+
changed_when: false
89+
register: schema_nis_loaded
90+
91+
- name: OpenLDAP - Load schema nis
92+
ansible.builtin.command: ldapadd -Q -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/nis.ldif
93+
when: not schema_nis_loaded.stdout
94+
95+
- name: OpenLDAP - Root
96+
community.general.ldap_entry:
97+
dn: dc=localdomain
98+
bind_dn: "{{ ldap_user }}"
99+
bind_pw: "{{ ldap_password }}"
100+
objectClass:
101+
- dcObject
102+
- organizationalUnit
103+
attributes:
104+
ou: localdomain
105+
106+
- name: OpenLDAP - OU for User
107+
community.general.ldap_entry:
108+
bind_dn: "{{ ldap_user }}"
109+
bind_pw: "{{ ldap_password }}"
110+
dn: ou=users,dc=localdomain
111+
objectClass: organizationalUnit
112+
113+
- name: OpenLDAP - User administrator
114+
community.general.ldap_entry:
115+
bind_dn: "{{ ldap_user }}"
116+
bind_pw: "{{ ldap_password }}"
117+
dn: cn=administrator,ou=users,dc=localdomain
118+
objectClass: inetOrgPerson
119+
attributes:
120+
sn: User
121+
description: Administrator
122+
userPassword: "{{ ldap_password_encrypted }}"
123+
givenName: Administrator
124+
mail: administrator@localdomain
125+
uid: administrator
126+
127+
- name: OpenLDAP - User viewer
128+
community.general.ldap_entry:
129+
bind_dn: "{{ ldap_user }}"
130+
bind_pw: "{{ ldap_password }}"
131+
dn: cn=viewer,ou=users,dc=localdomain
132+
objectClass: inetOrgPerson
133+
attributes:
134+
sn: User
135+
description: Viewer
136+
userPassword: "{{ ldap_password_encrypted }}"
137+
givenName: Viewer
138+
mail: viewer@localdomain
139+
uid: viewer
140+
141+
- name: OpenLDAP - User selfservice
142+
community.general.ldap_entry:
143+
bind_dn: "{{ ldap_user }}"
144+
bind_pw: "{{ ldap_password }}"
145+
dn: cn=selfservice,ou=users,dc=localdomain
146+
objectClass: inetOrgPerson
147+
attributes:
148+
sn: User
149+
description: Selfservice
150+
userPassword: "{{ ldap_password_encrypted }}"
151+
givenName: Selfservice
152+
mail: selfservice@localdomain
153+
uid: selfservice
154+
155+
- name: OpenLDAP - OU for Groups
156+
community.general.ldap_entry:
157+
bind_dn: "{{ ldap_user }}"
158+
bind_pw: "{{ ldap_password }}"
159+
dn: ou=groups,dc=localdomain
160+
objectClass: organizationalUnit
161+
162+
- name: OpenLDAP - Group admins
163+
community.general.ldap_entry:
164+
bind_dn: "{{ ldap_user }}"
165+
bind_pw: "{{ ldap_password }}"
166+
dn: cn=admins,ou=groups,dc=localdomain
167+
objectClass: posixGroup
168+
attributes:
169+
description: Admins
170+
gidNumber: 666
171+
memberUid: administrator
172+
173+
- name: Stop firewalld
174+
ansible.builtin.service:
175+
name: firewalld
176+
state: stopped
177+
enabled: false

0 commit comments

Comments
 (0)