tech:notes_cobbler
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
| tech:notes_cobbler [2025/11/09 19:02] – Jean-Baptiste | tech:notes_cobbler [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Notes Cobbler | ||
| + | |||
| + | |||
| + | Liens : | ||
| + | * http:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * Cobbler Debian repo https:// | ||
| + | |||
| + | Voir aussi : | ||
| + | [[cobbler_deploiement_ubuntu_ou_debian|Cobbler déploiement Ubuntu ou Debian]] | ||
| + | |||
| + | |||
| + | ## Installation sur CentOS7 | ||
| + | |||
| + | |||
| + | |||
| + | Désactivation de SELinux | ||
| + | |||
| + | `/ | ||
| + | ~~~ini | ||
| + | SELINUX=disabled | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | setenforce 0 | ||
| + | ~~~ | ||
| + | |||
| + | Après l' | ||
| + | ~~~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 | ||
| + | ~~~ | ||
| + | |||
| + | ~~~ | ||
| + | / | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | systemctl start cobblerd.service | ||
| + | systemctl status cobblerd.service | ||
| + | systemctl enable cobblerd.service | ||
| + | |||
| + | systemctl start httpd | ||
| + | systemctl enable httpd | ||
| + | ~~~ | ||
| + | |||
| + | `/ | ||
| + | ~~~ | ||
| + | # 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: | ||
| + | |||
| + | manage_dhcp: | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
| + | 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 | ||
| + | |||
| + | 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 ' | ||
| + | 2 : SELinux is enabled. Please review the following wiki page for details on ensuring cobbler works correctly in your SELinux environment: | ||
| + | https:// | ||
| + | 3 : some network boot-loaders are missing from / | ||
| + | 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 / | ||
| + | 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 / | ||
| + | |||
| + | ~~~bash | ||
| + | systemctl restart cobblerd.service | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | cobbler sync | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Cobbler pour Ubuntu | ||
| + | |||
| + | Soit nous utiliserons Preseed, le systeme de Debian/ | ||
| + | |||
| + | Soit nous utiliserons Kickstart, le système de RedHat/ | ||
| + | |||
| + | Kickstart Ubuntu | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | Kickstart Ubuntu - Exemple | ||
| + | * https:// | ||
| + | * https:// | ||
| + | |||
| + | |||
| + | 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 / | ||
| + | !!! TASK FAILED !!! | ||
| + | ~~~ | ||
| + | |||
| + | PS : C'est que je n'ai pas suivi correctement la doc https:// | ||
| + | |||
| + | De plus il faut faire | ||
| + | |||
| + | |||
| + | On jette un œil dans | ||
| + | * http:// | ||
| + | * / | ||
| + | |||
| + | 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: / | ||
| + | ~~~ | ||
| + | |||
| + | 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' | ||
| + | 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: | ||
| + | ~~~ | ||
| + | |||
| + | Sur l' | ||
| + | ~~~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> | ||
| + | |||
| + | # 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:// | ||
| + | |||
| + | `/ | ||
| + | ~~~xml | ||
| + | < | ||
| + | < | ||
| + | <bridge name=" | ||
| + | <forward mode=" | ||
| + | <ip address=" | ||
| + | < | ||
| + | <range start=" | ||
| + | </ | ||
| + | </ip> | ||
| + | </ | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | virsh net-define / | ||
| + | virsh net-start default | ||
| + | virsh net-autostart default | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | export COBBLER_SERVER=192.168.21.3 | ||
| + | koan --virt --wait=-1 --system=test1 # | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Cobbler | ||
| + | |||
| + | ~~~ | ||
| + | ssh -R: | ||
| + | export https_proxy=http:// | ||
| + | export http_proxy=http:// | ||
| + | |||
| + | cat / | ||
| + | [epel] | ||
| + | name=Extra Packages for Enterprise Linux 7 - $basearch | ||
| + | baseurl=http:// | ||
| + | # | ||
| + | failovermethod=priority | ||
| + | enabled=1 | ||
| + | gpgcheck=0 | ||
| + | # | ||
| + | |||
| + | |||
| + | subscription-manager repos --enable=' | ||
| + | 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 | ||
| + | |||
| + | / | ||
| + | next_server: | ||
| + | server: 192.168.21.3 | ||
| + | proxy_url_ext: | ||
| + | |||
| + | systemctl restart cobblerd.service | ||
| + | |||
| + | cobbler check | ||
| + | |||
| + | / | ||
| + | # | ||
| + | disable | ||
| + | ~~~ | ||
| + | |||
| + | ### Autres | ||
| + | |||
| + | #### Version os connus | ||
| + | |||
| + | ~~~bash | ||
| + | osinfo-query os | ||
| + | ~~~ | ||
| + | |||
| + | ### Pb | ||
| + | |||
| + | ~~~ | ||
| + | # cobbler import --name=rhel --path=/ | ||
| + | task started: 2017-10-04_140324_import | ||
| + | task started (id=Media import, time=Wed Oct 4 14:03:24 2017) | ||
| + | No signature matched in / | ||
| + | !!! TASK FAILED !!! | ||
| + | ~~~ | ||
| + | |||
| + | Solution | ||
| + | ~~~bash | ||
| + | cobbler import --name=rhel --path=/ | ||
| + | ~~~ | ||
| + | |||
| + | Voir / | ||
| + | |||
| + | ~~~bash | ||
| + | cobbler get-loaders | ||
| + | cobbler signature update | ||
| + | ~~~ | ||
| + | |||
| + | Penser à faire le ménage dans `/ | ||
| + | |||
| + | Réseaux : | ||
| + | Server settings | ||
| + | ~~~ | ||
| + | default_virt_bridge = br0 | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | |||
