blog
Table des matières
4 billet(s) pour janvier 2026
| AWX sur K8S Kind - partage de fichier pour les blob - Execution pods | 2026/01/26 10:15 | Jean-Baptiste |
| Notes rsh rcp | 2026/01/21 18:08 | Jean-Baptiste |
| Git - Duplication d'un dépôt | 2026/01/19 10:22 | Jean-Baptiste |
| Exemple simple de conf Nagios | 2026/01/14 10:07 | Jean-Baptiste |
Notes install silencieuse RedHat KickStart
Voir :
Voir aussi
Voir /root/anaconda-ks.cfg
ks.cfg
#bootloader --location=mbr --boot-drive=sda --append="hpsa.hpsa_allow_any=1"
bootloader --location=mbr --boot-drive=sda --append="biosdevname=0 net.ifnames=0"
clearpart --all --initlabel
ignoredisk --only-use=sda
zerombr
## Allow anaconda to partition the system as needed
##autopart --type=lvm
#part /boot --fstype="ext4" --ondisk=sda --asprimary --size=256
##part swap --asprimary --size=4096
#part pv.01 --fstype="lvmpv" --ondisk=sda --asprimary --size=200 --grow
#volgroup vg_sys --pesize=4096 pv.01
#logvol /home --fstype="xfs" --name=lv_home --vgname=vg_sys --size=1024
#logvol / --fstype="xfs" --name=lv_root --vgname=vg_sys --size=5120
#logvol swap --fstype swap --name=lv_swap --vgname=vg_sys --recommended
##logvol /app --fstype="xfs" --name=lv_app --vgname=vg_sys --size=200 --grow
# La partition ESP pour les machines EFI aura une taille minimale de 500 Mio au lieu de 200 Mio
part /boot/efi --fstype="efi" --ondisk=sda --size=1024 --fsoptions="umask=0077,shortname=winnt"
part /boot --fstype="xfs" --ondisk=sda --size=1024
part pv.10 --fstype="lvmpv" --ondisk=sda --size=184401
volgroup rhel --pesize=4096 pv.10
logvol /home --fstype="xfs" --size=5000 --name=home --vgname=rhel
logvol swap --fstype="swap" --size=3200 --name=swap --vgname=rhel
logvol / --fstype="xfs" --size=102400 --name=root --vgname=rhel
firewall --disabled
selinux --disabled
firstboot --disable
keyboard --vckeymap=fr-oss --xlayouts='fr (oss)'
lang fr_FR.UTF-8
timezone Europe/Paris --isUtc
text
reboot
install
skipx
auth --enableshadow --passalgo=sha512
rootpw --iscrypted $6$16qezferzg55SAL$vnD4POyadqj7x27GUWARljI6.rgezBlTK/7fzsRj9C2S43jONnWDzMSOOMGulsay2YFeIl.
user --name=dev --password=$6$W8NI3UWFLLZOZOZJO8pZoyn5oH0LNtveNEWtP.WL5.LTwGDS1bmFwBHSbci.3yB491 --iscrypted --gecos="dev"
%pre
#%pre --erroronfail
set -x -v
exec 1>/tmp/ks-pre.log 2>&1
# Once root's homedir is there, copy over the log.
while : ; do
sleep 10
if [ -d /mnt/sysimage/root ]; then
cp /tmp/ks-pre.log /mnt/sysimage/root/
logger "Copied %pre section log to system"
break
fi
done &
%end
services --enabled=sshd,network --disabled=NetworkManager,dhcdbd
%packages
@core
chrony
%end
%post --nochroot
set -x -v
exec 1>/mnt/sysimage/root/ks-post-nochroot.log 2>&1
%end
%post
set -x -v
exec 1>/root/ks-post.log 2>&1
# Start yum configuration
#curl "http://192.168.100.159/cblr/svc/op/yum/system/test02" --output /etc/yum.repos.d/cobbler-config.repo
cd /root
mkdir --mode=700 .ssh
cat >> .ssh/authorized_keys <<EOF
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDOpSuQISNltnRl5e2lBZ+poH68lY+pMewPOsLM6wvRo9uvEdLgLZBBoYDLgoNhZwT1wvPQSAn7AbHZhmarX3kGlp/0G2yGGzlsn0820KuqLG4Q9ert2x3lg/oeBN4SkbGNplf6QOLN4q2u/z6PJ60I6OyGnA2yEyHekY5fVYjvyXcRMriJrthbdt7hBcwvNAZldzco36gSNhhe4E9WnsVp19jZvjpesEI2jhXBBgk3ewao3sdDnH+LE5rj3VP0bYlgoErDoKlUlSspKmtd16CPvBn0a38msQlj89JxvbC2TrkTOoxQPzXEkuQOXicTxo3E8bvm5EvKXWb0bBYUTtvf jibe@debian2.localdomain
EOF
chmod 600 .ssh/authorized_keys
echo "myhostname.localdomain" > /etc/hostname
#network --hostname=myhostname
rpm -e biosdevname
cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=dhcp
#DEFROUTE=yes
IPV6INIT=no
IPV4_FAILURE_FATAL=no
NAME=eth0
DEVICE=eth0
ONBOOT=yes
NM_CONTROLLED=no
EOF
# End final steps
%end
Vérif
yum install pykickstart # ou pip install pykickstart
ksvalidator ks.cfg
Lancer le kickstart placé sur un serveur Web
linux ks=http://172.18.21.1/redhat/ks.cfg ip=192.168.0.100 gw=192.168.254.254 dns=192.168.0.2 ksdevice=eth0
Inclure le fichier kickstart dans l'iso
Pour boot si BIOS non UEFI
mount -o ro /dev/cdrom /mnt/iso/ rsync -a -H --delete --chmod=u+w /mnt/iso/ /tmp/ks/iso/ umount /mnt/iso/ vim /tmp/ks/iso/isolinux/isolinux.cfg cp -p /tmp/ks/ks.cfg /tmp/ks/iso/
isolinux/isolinux.cfg
label linux menu label ^Install Red Hat Enterprise Linux 7.0 - ks (label) menu default kernel vmlinuz #append initrd=initrd.img inst.stage2=hd:sdb2:/ ks=hd:sdb1:/ks.cfg append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.0\x20Server.x86_64 ks=hd:LABEL=RHEL-7.0\x20Server.x86_64:/ks.cfg biosdevname=0 net.ifnames=0 label linux menu label ^Install Red Hat Enterprise Linux 7.0 - ks (cdrom) kernel vmlinuz append initrd=initrd.img inst.stage2=cdrom ks=cdrom:/ks.cfg label linux menu label ^Install Red Hat Enterprise Linux 7.0 kernel vmlinuz append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.0\x20Server.x86_64 quiet
Pour UEFI
grub.cfg
### BEGIN /etc/grub.d/10_linux ### menuentry 'Install Red Hat Enterprise Linux 7.2' --class fedora --class gnu-linux --class gnu --class os { linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=RHEL-7.2\x20Server.x86_64 quiet initrdefi /images/pxeboot/initrd.img } menuentry 'KickStart install' --class fedora --class gnu-linux --class gnu --class os { linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=RHEL-7.2\x20Server.x86_64 ks=hd:LABEL=RHEL-7.2\x20Server.x86_64:/ks1.cfg initrdefi /images/pxeboot/initrd.img }
Modif de efiboot.img
mkdir /mnt/tmp mount images/efiboot.img /mnt/tmp/ vim /mnt/tmp/EFI/BOOT/grub.cfg umount /mnt/tmp
cd /tmp/ks/iso/ genisoimage -iso-level 4 -U -r -v -T -J -joliet-long -V "RHEL-7.0 Server.x86_64" -volset "RHEL-7.0 Server.x86_64" -A "RHEL-7.0 Server.x86_64" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -o /tmp/ks/rh7-ks.iso . isohybrid -u /tmp/ks/rh7-ks.iso implantisomd5 /tmp/ks/rh7-ks.iso
Note : le parametre suivant va ensemble -eltorito-alt-boot -e images/efiboot.img
Autres
La petite partition /boot dédiée sur le disque local est formatée usuellement en ext2 (ou FAT32 dans le cadre d’un système UEFI).
Se passer de Grub
Voir :
bootloader --sdbootetinst.sdboot
Notes install RedHat
yum install epel-release yum install bash-completion # yum install bash-completion bash-completion-extras
Kickstart EFI UEFI
Voir
#grub2-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=redhat --recheck /dev/sda --force #grub2-mkconfig -o /boot/grub2/grub.cfg #grub2-install --modules=part_gpt --target=i386-pc --recheck --boot-directory=/boot /dev/sda --force #/sbin/grub2-install /dev/sda #yum reinstall -y grub-efi shim-x64
Paquets EFI
- efi-filesystem
- shim-x64
- efivar
- efivar-libs
- efibootmgr
- grub2-efi
- grub2-efi-modules
Notes inotify
Liens :
apt-get install inotify-tools inotifywait -r / cat /proc/sys/fs/inotify/max_user_watches echo 50000 > /proc/sys/fs/inotify/max_user_watches inotifywait -e modify -r -m /var/log
Exécuter quelques chose à chaque changement dans une arborescence
source : https://www.geekarea.fr/wordpress/?p=783
while inotifywait -r -e modify -e move -e create -e delete --exclude .swp .; do pkill flask; sleep 1; flask run --host=0.0.0.0 & done
Bash astuce raccourcis clavier
Source :
Ctrl - l : Clear Screen (space) cmd : Skip cmd from history (if HISTCONTROL=ignoreboth ~/.bashrc) Ctrl - x e : Edit cmd in editor Alt - . : Last arg Ctrl - e : Clear Begin Of Line Ctrl - k : Clear End Of Line Ctrl - u ... Ctrl - y : Remove/recover cmd Ctrl - h : Suppr (backspace) Ctrl - j : Enter
Notes initramfs
Voir aussi :
- tinyramfs
initramfs-tools (0.119) unstable; urgency=medium
- The initramfs will now run fsck on the root filesystem before
mounting it. If the chosen init program is systemd and there is a
separate /usr filesystem, it will also fsck and mount /usr.
* If the /usr filesystem is on a RAID device and the INITRDSTART setting
in /etc/default/mdadm is not 'all', you will need to change it to
include that device.
* If the RTC (real time clock) is set to local time and the local time is
ahead of UTC, e2fsck will print a warning during boot about the time
changing backward (bug #767040). You can disable this by putting the
following lines in /etc/e2fsck.conf:
[options]
broken_system_clock=1
-- Ben Hutchings ben@decadent.org.uk Sat, 17 Jan 2015 16:56:56 +0000
blog.txt · Dernière modification : de 127.0.0.1
