User Tools

Site Tools


userspace:centos_6.3

This is an old revision of the document!


CentOS release 6.3

These are my personal notes for installing OPSI on a CentOS 6.3 server, and may be of help to others.
Of course I also used the getting started documentation.
For installing the CentOS-6.3-x86_64-bin-DVD1.iso was used, because LiveCD iso's do not include minimal install options. It might still be possible, to do a minimal install with a LiveCD, but I was too lazy to find out. So this is about a minimal install, without any additional packages.

preparation

In the DHCP server on the network we use the mac address of the OPSI server to set a static lease. We also set extra options for the DHCP server, which should reflect your own network setup: dhcp-boot=linux/pxelinux.0,opsi.anarchy.lan,10.0.0.97
With a different DHCP server you will have to look for the correct commands.
(insert opsi1.jpg blah)
I use Spacewalk to manage my CentOS servers, so installation of packages and updates is done via Spacewalk. That is why the yum commands may be incorrect, I did not use them myself, and am making them up. In the getting started documentation is mentioned how to add the OPSI repository.

After installing CentOS we turn on the network by editing: /etc/sysconfig/network-scripts/ifcfg-eth0
ONBOOT=“no” should become ONBOOT=“yes”
After saving this file, we restart the network with this command: /etc/init.d/network restart
Now the CentOS server gets the IP address which was set in the DHCP server. This saves a lot of trouble, no messing with resolv.conf and hostname -f returns the correct hostname.

first part of installation

We first install xinetd and samba, then we start their services and make sure they start again when rebooting the server:
yum install xinetd samba
/etc/init.d/smb start
/etc/init.d/nmb start
/etc/init.d/xinetd start
chkconfig smb on
chkconfig nmb on
chkconfig xinetd on

As you can see, mysql is not installed, but I do not have a license for the mysql-module, so we are going to use the file backend and do not need mysql. It might also be easier to configure if you do not have much experience.

Now we install the OPSI packages:
yum install p7zip p7zip-plugins cabextract
yum install opsi-depotserver opsi-configed

This is shamelessly copied from the getting started documentation:
/etc/init.d/opsiconfd restart
/etc/init.d/opsipxeconfd restart
opsi-setup –auto-configure-samba
chkconfig opsiconfd on
chkconfig opsipxeconfd on
/etc/init.d/smb restart
/etc/init.d/nmb restart

iptables configuration

To make OPSI work correctly we have to open some ports on the firewall. I can never remember the iptables commands, and with Spacewalk I deployed the following to: /etc/sysconfig/network/iptables:

# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 69 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 137 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 138 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 139 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 445 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 4441 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 4447 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

We then restart iptables: /etc/init.d/iptables restart
TCP port 22 is used by SSH. UDP port 69 is used by the TFTP server.
UDP ports 137, 137 and TCP ports 139 and 445 are used by Samba.
TCP ports 4441 and 4447 are of course used by OPSI.

opsi configuration

Now we are going to edit the opsi configuration files:
This is /etc/opsi/backendManager/dispatch.conf:

backend_.*         : file, opsipxeconfd
host_.*            : file, opsipxeconfd
productOnClient_.* : file, opsipxeconfd
configState_.*     : file, opsipxeconfd
.*                 : file

/etc/opsi/opsiconfd.conf has only been edited minimally. I think I only edited 'update ip'. Comments removed for readability:

[global]
        backend config dir = /etc/opsi/backends
        dispatch config file = /etc/opsi/backendManager/dispatch.conf
        extension config dir = /etc/opsi/backendManager/extend.d
        acl file = /etc/opsi/backendManager/acl.conf
        admin networks = 0.0.0.0/0
        message bus = no
        multiprocessing = no
        pid file = /var/run/opsiconfd/opsiconfd.pid
        log file = /var/log/opsi/opsiconfd/%m.log
        symlink logs = yes
        log level = 5
        log format = [%l] [%D] %M (%F|%N)
        max execution statistics = 250
        monitoring user = monitoring
 
[service]
        interface = 0.0.0.0
        http port = 0
        https port = 4447
        ssl server cert = /etc/opsi/opsiconfd.pem
        ssl server key = /etc/opsi/opsiconfd.pem
 
[session]
        session name = OPSISID
        verify ip = no
        update ip = yes
        max inactive interval = 120
        max authentication failures = 5
 
[directories]
        / = /usr/share/opsiconfd/static (noauth)
        configed = /usr/lib/configed (noauth)

The same is valid for /etc/opsi/backends/hostcontrol.conf but this file is entirely standard:

# -*- coding: utf-8 -*-
 
module = 'HostControl'
config = {
    "opsiclientdPort":    4441,
    "hostRpcTimeout":     15,
    "resolveHostAddress": False,
    "maxConnections":     50,
    "broadcastAddresses": ["255.255.255.255"]

second part of installation

Now we fire off the next part of commands:
opsi-setup –init-current-config
opsi-setup –set-rights
/etc/init.d/opsiconfd restart
/etc/init.d/opsipxeconfd restart

We also have to install a Java runtime:
yum install java-1.7.0-openjdk
I did not have any problems

update-alternatives –config java aslk;djfl;kjasdf

work in progress

userspace/centos_6.3.1360173154.txt.gz · Last modified: 2021/08/23 08:37 (external edit)