Outils pour utilisateurs

Outils du site


tech:notes_cobbler

Ceci est une ancienne révision du document !


Notes Cobbler

Installation sur CentOS7

Désactivation de SELinux

/etc/selinux/config
SELINUX=disabled
setenforce 0

Après l'activation des dépôts EPEL

yum install cobbler-web cobbler dhcp xinetd
systemctl start xinetd

On cherche le nom du service

#rpm -q --filesbypkg cobbler |grep systemd
rpm -ql cobbler |grep systemd
/usr/lib/systemd/system/cobblerd.service
systemctl start cobblerd.service
systemctl status cobblerd.service
systemctl enable cobblerd.service
 
systemctl start httpd
systemctl enable httpd
/etc/cobbler/settings
# IP du serveur Web Cobbler. Koan devra pouvoir joindre cette IP
server: 192.168.100.159

# IP du serveur Cobbler/PXE (interface qui fera office de DHCP)
next_server: 192.168.102.1

manage_dhcp: 1

Souvent server et next_server aurons la même adresse IP. Dans mon cas, j'ai mis Cobbler dans une VM en CentOS. La VM cobbler ici à deux interfaces réseaux :

  • 192.168.100.159 Sur réseau NAT, qui peut sortir sur internet pour les yum install et autres
  • 192.168.102.1 Sur réseau isolé, destiné au PXE et au DHCP

Après avoir modifié ce fichier

systemctl restart cobblerd.service
cobbler check
The following are potential configuration items that you may want to fix:

1 : For PXE to be functional, the 'next_server' field in /etc/cobbler/settings must be set to something other than 127.0.0.1, and should match the IP of the boot server on the PXE network.
2 : SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment:
    https://github.com/cobbler/cobbler/wiki/Selinux
3 : some network boot-loaders are missing from /var/lib/cobbler/loaders, you may run 'cobbler get-loaders' to download them, or, if you only want to handle x86/x86_64 netbooting, you may ensure that you have installed a *recent* version of the syslinux package installed and can ignore this message entirely.  Files in this directory, should you want to support all architectures, should include pxelinux.0, menu.c32, elilo.efi, and yaboot. The 'cobbler get-loaders' command is the easiest way to resolve these requirements.
4 : enable and start rsyncd.service with systemctl
5 : debmirror package is not installed, it will be required to manage debian deployments and repositories
6 : ksvalidator was not found, install pykickstart
7 : The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed, try: "openssl passwd -1 -salt 'random-phrase-here' 'your-password-here'" to generate new one
8 : fencing tools were not found, and are required to use the (optional) power management features. install cman or fence-agents to use them

Nous continuons de suivre les recommendations de cobbler check

cobbler get-loaders
yum install pykickstart
systemctl start rsyncd.service
systemctl enable rsyncd.service
openssl passwd -1

On change le default_password_crypted de /etc/cobbler/settings

systemctl restart cobblerd.service
cobbler sync

Cobbler pour Ubuntu

Soit nous utiliserons Preseed, le systeme de Debian/Ubuntu

Soit nous utiliserons Kickstart, le système de RedHat/CentOS partiellement porté sur Ubuntu

Kickstart Ubuntu

Kickstart Ubuntu - Exemple

Vérif

cobbler check
cobbler import --name=ubuntu-server --path=/mnt --breed=ubuntu --os-version=16.04 --arch=x86_64
task started: 2016-06-01_141407_import
task started (id=Media import, time=Wed Jun  1 14:14:07 2016)
No signature matched in /var/www/cobbler/ks_mirror/ubuntu-server-x86_64
!!! TASK FAILED !!!

PS : C'est que je n'ai pas suivi correctement la doc https://help.ubuntu.com/community/Cobbler/Import

De plus il faut faire

On jette un œil dans

Solution

cobbler signature update

et mettre le bon --os-version

cobbler import --name=ubuntu-server --path=/mnt --breed=ubuntu --os-version=xenial --arch=x86_64

Pour info :

trying symlink: /var/www/cobbler/ks_mirror/ubuntu-server-x86_64 -> /var/www/cobbler/links/ubuntu-server-x86_64

Un profile a été crée

cobbler profile list
ubuntu-server-x86_64

Copions-le

cobbler profile copy --name=ubuntu-server-x86_64 --newname=buntutest1

Interface d'administration Web Cobbler https://192.168.100.159/cobbler_web
utilisateur : cobbler
pass : cobbler

Déploiement

Sur le serveur Cobbler --interface OK ?

cobbler system add --profile=CentOS-7-x86_64 --name=test01 --mac=52:54:00:DD:EE:FF --interface=eth0

Sur l'hyperviseur

koan --virt --wait=-1 --system=test01 --virt-bridge=virbr0

Configuration du dépôt

Voir Notes debmirror

yum install debmirror

Une fois que debmirror est configuré

cobbler reposync --only=ubuntu-server-x86_64

Effacement

Exemple

cobbler system remove --name=ttest02
cobbler profile remove --name=ubuntu-server-16.04.vm
cobbler profile remove --name=ubuntu-server-x86_64
cobbler distro remove --name=ubuntu-server-x86_64
cobbler repo remove --name=ubuntu-server-x86_64

Cobbler sur RedHat - notes en vrac

Cobbler

KVM Koan

Install

rpm -uvh koan-2.8.1-2.el7.noarch.rpm python2-simplejson-3.10.0-1.el7.x86_64.rpm python-ipaddr-2.1.11-1.el7.noarch.rpm virt-install-1.4.1-7.el7.noarch.rpm
 
# rpm -Uvh virt-manager-common-1.4.1-7.el7.noarch.rpm # Remplacé par Cockpit

Network bridge

virsh iface-bridge eth0 br0
virsh iface-unbridge br0

Network NAT

https://jamielinux.com/docs/libvirt-networking-handbook/nat-based-network.html

/tmp/default.xml
<network>
  <name>default</name>
  <bridge name="virbr0"/>
  <forward mode="nat"/>
  <ip address="192.168.122.1" netmask="255.255.255.0">
    <dhcp>
      <range start="192.168.122.2" end="192.168.122.254"/>
    </dhcp>
  </ip>
</network>
virsh net-define /tmp/default.xml
virsh net-start default
virsh net-autostart default
export COBBLER_SERVER=192.168.21.3
koan --virt --wait=-1 --system=test1 #--virt-bridge=virbr0 --server=192.168.21.3

Cobbler

ssh -R:3128:192.168.56.1:3128 cobbler
export https_proxy=http://127.0.0.1:3128
export http_proxy=http://127.0.0.1:3128

cat /etc/yum.repos.d/epel.repo 
[epel]
name=Extra Packages for Enterprise Linux 7 - $basearch
baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=0
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7


subscription-manager repos --enable='rhel-7-server-rpms'
subscription-manager repos --enable=rhel-7-server-extras-rpms
subscription-manager repos --enable=rhel-7-server-optional-rpms

# Disable selinux

yum update
yum install atop tmux cobbler cobbler-web

systemctl start cobblerd.service
systemctl enable cobblerd.service
 
systemctl start httpd
systemctl enable httpd

/etc/cobbler/settings
next_server: 192.168.53.10
server: 192.168.21.3
proxy_url_ext: "http://127.0.0.1:3128"

systemctl restart cobblerd.service

cobbler check

/etc/xinetd.d/tftp
#disable                 = yes
disable                 = no

Autres

Version os connus

osinfo-query os

Pb

# cobbler import --name=rhel --path=/mnt/iso --breed=redhat --os-version=7 --arch=x86_64
task started: 2017-10-04_140324_import                                                                                                                                                                               
task started (id=Media import, time=Wed Oct  4 14:03:24 2017)
No signature matched in /var/www/cobbler/ks_mirror/rhel-x86_64                                                                         
!!! TASK FAILED !!!    

Solution

cobbler import --name=rhel --path=/mnt/iso --breed=redhat --os-version=rhel7 --arch=x86_64

Voir /var/lib/cobbler/distro_signatures.json

cobbler get-loaders
cobbler signature update

Penser à faire le ménage dans /var/www/cobbler/ks_mirror/ en effacer les imports échouées

Réseaux : Server settings

default_virt_bridge = br0
tech/notes_cobbler.1742825205.txt.gz · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki