воскресенье, 24 марта 2024 г.

kickstart для минимальной установки redos для шаблона proxmox

lang en_US
keyboard --xlayouts='us'
timezone Europe/Moscow

zerombr
clearpart --all --initlabel
bootloader --location=mbr --append="net.ifnames=0"
autopart --type=plain

network --bootproto=dhcp --device=link --activate --onboot=on

firstboot --disable

#selinux
#selinux --enforcing
selinux --permissive
#selinux --disabledfirewall --enabled --ssh

#firewall
#firewall --enabled
firewall --disabled

authconfig --enableshadow --passalgo=sha512
#rootpw --plaintext redos --lock
rootpw --lock
#user --name=redos --groups=wheel --password=redos --gecos="defaultuser"
#sshkey --username=appc "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA7YUTXCKAMavLy98/Kep6eDKK2NyVEc/kUklZUbBubg4DfFHDO2KDXtFN7uq8HPcYR7uqFLqkRijhBwJbnPGLpp2mA+iOHLpJvD/tGpDyNt/ImM0hQG3+dzPLtvzc9Ln5mY2RUfOUTFEx7dqGVuwPQXMhZLCEkpIcGicPTpdG0CIu/GdELUtwgrZZ+reNXMG82VnFBVDZObL7H1YsmrgyyWBUMAzwf+EeUFk9Q4k8qsV8utONo3AvscaESxyt5UDvVuV7PrPxp28a03k9ybMMrXjPzuEaM2P0pxGT0VsIoR/fG78MwkSPTveX0QgDU4gBihOAcH2/2WHGBE+1pr9saw== appc@appc-pc"
#sshkey --username=root "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA7YUTXCKAMavLy98/Kep6eDKK2NyVEc/kUklZUbBubg4DfFHDO2KDXtFN7uq8HPcYR7uqFLqkRijhBwJbnPGLpp2mA+iOHLpJvD/tGpDyNt/ImM0hQG3+dzPLtvzc9Ln5mY2RUfOUTFEx7dqGVuwPQXMhZLCEkpIcGicPTpdG0CIu/GdELUtwgrZZ+reNXMG82VnFBVDZObL7H1YsmrgyyWBUMAzwf+EeUFk9Q4k8qsV8utONo3AvscaESxyt5UDvVuV7PrPxp28a03k9ybMMrXjPzuEaM2P0pxGT0VsIoR/fG78MwkSPTveX0QgDU4gBihOAcH2/2WHGBE+1pr9saw== appc@appc-pc"

%packages --multilib --ignoremissing
@Core
cloud-init
qemu-guest-agent
#net if name eth0 net.ifnames=0
-biosdevname
%end

#%post --nochroot --erroronfail --log=/tmp/ks-post.log
%post --erroronfail --log=/tmp/ks-post.log
echo post $(pwd)
#rootdir="/mnt/sysimage"
rootdir=""
echo issue
echo "\4" >> $rootdir/etc/issue
echo "\6" >> $rootdir/etc/issue
echo "" >> $rootdir/etc/issue

echo sudo
#echo "redos ALL:(ALL) NOPASSWD:ALL" > /etc/sudoers.d/redos

cat > $rootdir/etc/cloud/cloud.cfg.d/90-redos.cfg << EOF
datasource_list: [ NoCloud, ConfigDrive, None ]
runcmd:
  - rm -f /etc/machine-id
  - systemd-machine-id-setup
# System and/or distro specific settings
# (not accessible to handlers/transforms)
system_info:
   # This will affect which distro class gets used
   distro: redos
   # Default user name + that default users groups (if added/used)
   default_user:
     name: redos
     lock_passwd: True
     gecos: RedOS Cloud User
     groups: [wheel]
     sudo: ["ALL=(ALL) NOPASSWD:ALL"]
     shell: /bin/bash
   # Other config here will be given to the distro class and/or path classes
   paths:
      cloud_dir: /var/lib/cloud/
      templates_dir: /etc/cloud/templates/
   network:
      renderers: ['netplan', 'networkd', 'etcnet']
   ssh_svcname: sshd

EOF
%end

services --enabled=cloud-init,cloud-config,cloud-final,cloud-init-local
#метод завершения установки
#reboot
shutdown

Ратнер Арсений, arsenyratner@gmail.com, 7 985 273 2090

Комментариев нет:

Отправить комментарий