Skip to content

Commit

Permalink
updates to latest releases
Browse files Browse the repository at this point in the history
adds Ansible for configuration management
adds Monitoring integration plugin
disables ABRT because of incompatibility
  • Loading branch information
dgoetz committed Oct 16, 2017
1 parent 4fb4cb4 commit 04135ff
Show file tree
Hide file tree
Showing 41 changed files with 1,502 additions and 386 deletions.
2 changes: 1 addition & 1 deletion COPYING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Copyright (c) 2016 NETWAYS GmbH <[email protected]>

Material is licensed under (http://creativecommons.org/licenses/by-sa/4.0/)[http://creativecommons.org/licenses/by-sa/4.0/]
Material is licensed under [http://creativecommons.org/licenses/by-sa/4.0/](http://creativecommons.org/licenses/by-sa/4.0/)
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.2/foreman-training-handouts.pdf)
* [Exercises](https://github.com/NETWAYS/foreman-training/releases/download/v1.2/foreman-training-exercises.pdf)
* [Solutions](https://github.com/NETWAYS/foreman-training/releases/download/v1.2/foreman-training-solutions.pdf)
* [Handouts](https://github.com/NETWAYS/foreman-training/releases/download/v1.3/foreman-training-handouts.pdf)
* [Exercises](https://github.com/NETWAYS/foreman-training/releases/download/v1.3/foreman-training-exercises.pdf)
* [Solutions](https://github.com/NETWAYS/foreman-training/releases/download/v1.3/foreman-training-solutions.pdf)

## Provide your own training

Expand Down
27 changes: 14 additions & 13 deletions Setup.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,26 @@
# Setup

## Virtual machine
## Virtual machine foreman.localdomain

To setup a new version of the virtual machine install CentOS 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 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.

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.

## Local mirror

A Vagrant file is provided in the directory to setup a local mirror of CentOS 7 x86_64, EPEL 7 x86_64
Puppetlabs EPEL 7 x86_64, Foreman EPEL 7 x86_64 and the Discovery Image. This machine will require about
Puppet EPEL 7 x86_64, Foreman EPEL 7 x86_64 and the Discovery Image. This machine will require about
25GB.

## Katello Demo
Expand All @@ -20,7 +29,7 @@ To setup the Katello demo follow this guide (it requires vagrant and ansible to

# git clone https://github.com/Katello/forklift.git
# cd forklift
# vagrant up centos7-katello-3.2
# vagrant up centos7-katello-3.4

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

Expand All @@ -37,17 +46,9 @@ This will setup your Katello server, login with the provided credentials and add
* Assigned to Life Cycle Environment "Test" and Content View "CentOS7"
* Subscription to Repository "CentOS7-Base-x86_64"

Use this information to deploy some docker containers as Content Hosts:

# cd docker/clients/
# cp docker-compose.yml.example docker-compose.yml
# vi docker-compose.yml
# docker-compose scale el7=5

Or register the system to itself:
Register the system to itself:

# vagrant ssh centos7-katello-3.2
# yum -y install https://fedorapeople.org/groups/katello/releases/yum/3.2/client/el7/x86_64/katello-client-repos-latest.rpm
# vagrant ssh centos7-katello-3.4
# yum -y install katello-agent http://$(hostname -f)/pub/katello-ca-consumer-latest.noarch.rpm
# subscription-manager register --org Default_Organization --activationkey="CentOS7-Test"

16 changes: 7 additions & 9 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Vagrant.configure(2) do |config|

# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "https://download.gluster.org/pub/gluster/purpleidea/vagrant/centos-7.1/centos-7.1.box"
config.vm.box = "centos/7"
config.vm.hostname = "mirror"
config.vm.synced_folder ".", "/vagrant", type: "rsync"

Expand Down Expand Up @@ -68,19 +68,17 @@ Vagrant.configure(2) do |config|
# documentation for more information about their specific syntax and use.
config.vm.provision "shell", inline: <<-SHELL
sleep 10
sudo yum -y install rsync httpd
sudo yum -y install rsync httpd wget
sudo systemctl enable httpd.service
sudo systemctl start httpd.service
# CentOS 7
sudo mkdir -p /var/www/html/centos/7.2.1511/os/
sudo ln -s /var/www/html/centos/7.2.1511 /var/www/html/centos/7
sudo rsync -avSHP --delete --exclude "local*" --exclude "isos" mirror.eu.oneandone.net::centos/7.2.1511/os/ /var/www/html/centos/7.2.1511/os/
sudo mkdir -p /var/www/html/centos/7.4.1708/os/
sudo ln -s /var/www/html/centos/7.4.1708 /var/www/html/centos/7
sudo rsync -avSHP --delete --exclude "local*" --exclude "isos" mirror.eu.oneandone.net::centos/7.4.1708/os/ /var/www/html/centos/7.4.1708/os/
sudo mkdir -p /var/www/html/epel/7/x86_64/
sudo rsync -vaH --exclude="debug*" --numeric-ids --delete --delete-after --delay-updates rsync://rsync.hrz.tu-chemnitz.de/fedora-epel/7/x86_64/ /var/www/html/epel/7/x86_64/
sudo mkdir -p /var/www/html/puppetlabs/el/7/dependencies/x86_64/
sudo rsync -av --copy-links --del rsync://yum.puppetlabs.com/packages/yum/el/7/dependencies/x86_64/ /var/www/html/puppetlabs/el/7/dependencies/x86_64/
sudo mkdir -p /var/www/html/puppetlabs/el/7/products/x86_64/
sudo rsync -av --copy-links --del rsync://yum.puppetlabs.com/packages/yum/el/7/products/x86_64/ /var/www/html/puppetlabs/el/7/products/x86_64/
sudo mkdir -p /var/www/html/puppet5/el/7/x86_64/
sudo rsync -av --copy-links --del rsync://yum.puppet.com/packages/yum/puppet5/el/7/x86_64/ /var/www/html/puppet5/el/7/x86_64/
sudo mkdir -p /var/www/html/foreman/releases/latest/el7/x86_64/
sudo rsync -av --copy-links --del rsync://yum.theforeman.org/yum/releases/latest/el7/x86_64/ /var/www/html/foreman/releases/latest/el7/x86_64/
sudo mkdir -p /var/www/html/foreman/plugins/latest/el7/x86_64/
Expand Down
3 changes: 3 additions & 0 deletions _files/share/finish.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
echo "foreman.localdomain" > /etc/hostname
echo "10.0.0.1 host.localdomain host" >> /etc/hosts
echo "10.0.0.2 foreman.localdomain foreman" >> /etc/hosts
echo "10.0.0.3 monitoring.localdomain monitoring" >> /etc/hosts

yum install -y openldap-servers openldap-clients

Expand Down Expand Up @@ -77,3 +78,5 @@ ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/openldap/schema/nis.ldif
ldapadd -x -D "cn=admin,dc=localdomain" -w netways -f domain.ldif
ldapadd -x -D "cn=admin,dc=localdomain" -w netways -f users.ldif

systemctl disable firewalld
systemctl stop firewalld
9 changes: 9 additions & 0 deletions _files/share/monitoring/finish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
yum install epel-release -y
yum install http://yum.puppetlabs.com/puppet5/puppet5-release-el-7.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 monitoring.localdomain.pp
27 changes: 27 additions & 0 deletions _files/share/monitoring/icingaweb2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Alias /icingaweb2 "/usr/share/icingaweb2/public"

<Directory "/usr/share/icingaweb2/public">
Options SymLinksIfOwnerMatch
AllowOverride None

SetEnv ICINGAWEB_CONFIGDIR "/etc/icingaweb2"

EnableSendfile Off

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /icingaweb2/
RewriteCond %{REMOTE_ADDR} ^10\.0\.0\.2
RewriteRule ^(.*)$ - [E=REMOTE_USER:foreman]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>

<IfModule !mod_rewrite.c>
DirectoryIndex error_norewrite.html
ErrorDocument 404 /error_norewrite.html
</IfModule>
</Directory>
Loading

0 comments on commit 04135ff

Please sign in to comment.