{{tag>Brouillon Déploiement Boot}} # Notes Cobbler Liens : * http://thinlight.org/2014/11/08/getting-started-with-cobbler/ * https://help.ubuntu.com/community/Cobbler * https://access.redhat.com/documentation/en-US/Red_Hat_Network_Satellite/5.3/html/Reference_Guide/ch-cobbler.html * Cobbler Debian repo https://fedorahosted.org/cobbler/wiki/DebianDeployment Voir aussi : [[cobbler_deploiement_ubuntu_ou_debian|Cobbler déploiement Ubuntu ou Debian]] ## Installation sur CentOS7 Désactivation de SELinux `/etc/selinux/config` ~~~ini SELINUX=disabled ~~~ ~~~bash setenforce 0 ~~~ Après l'activation des dépôts EPEL ~~~bash yum install cobbler-web cobbler dhcp xinetd systemctl start xinetd ~~~ On cherche le nom du service ~~~bash #rpm -q --filesbypkg cobbler | grep systemd rpm -ql cobbler | grep systemd ~~~ ~~~ /usr/lib/systemd/system/cobblerd.service ~~~ ~~~bash 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 ~~~bash systemctl restart cobblerd.service ~~~ ~~~bash 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` ~~~bash cobbler get-loaders ~~~ ~~~bash yum install pykickstart ~~~ ~~~bash systemctl start rsyncd.service systemctl enable rsyncd.service ~~~ ~~~bash openssl passwd -1 ~~~ On change le `default_password_crypted` de /etc/cobbler/settings ~~~bash systemctl restart cobblerd.service ~~~ ~~~bash 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 * https://infoscience.epfl.ch/record/209242/files/5-12-page12.pdf * https://help.ubuntu.com/community/KickstartCompatibility Kickstart Ubuntu - Exemple * https://gist.github.com/vrillusions/d292953ff9bc0e2041d9 * https://gist.github.com/ludo/3652811 Vérif ~~~bash cobbler check ~~~ ~~~bash 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 * http://cobbler.github.io/signatures/2.6.x/latest.json * /var/lib/cobbler/distro_signatures.json Solution ~~~bash cobbler signature update ~~~ et mettre le bon `--os-version` ~~~bash 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 ~~~bash cobbler profile list ~~~ ~~~ ubuntu-server-x86_64 ~~~ Copions-le ~~~bash 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 ? ~~~bash cobbler system add --profile=CentOS-7-x86_64 --name=test01 --mac=52:54:00:DD:EE:FF --interface=eth0 ~~~ Sur l'hyperviseur ~~~bash koan --virt --wait=-1 --system=test01 --virt-bridge=virbr0 ~~~ ### Configuration du dépôt Voir [[Notes debmirror]] ~~~bash yum install debmirror ~~~ Une fois que debmirror est configuré ~~~bash cobbler reposync --only=ubuntu-server-x86_64 ~~~ ## Effacement Exemple ~~~bash 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 {{tag>Brouillon}} # Cobbler Voir [[cobbler_deploiement_de_debian]] ## KVM Koan ### Install ~~~bash 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 ~~~bash 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` ~~~xml default ~~~ ~~~bash virsh net-define /tmp/default.xml virsh net-start default virsh net-autostart default ~~~ ~~~bash 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 ~~~bash 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 ~~~bash cobbler import --name=rhel --path=/mnt/iso --breed=redhat --os-version=rhel7 --arch=x86_64 ~~~ Voir /var/lib/cobbler/distro_signatures.json ~~~bash 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 ~~~