refactor: move Packer templates to top-level packer/ directory
This commit is contained in:
74
packer/ubuntu-24.04/http/ks.cfg
Normal file
74
packer/ubuntu-24.04/http/ks.cfg
Normal file
@@ -0,0 +1,74 @@
|
||||
# Kickstart file for Fedora 41 Server (Text-based Installation)
|
||||
#
|
||||
# For use with the Fedora Server netinstall ISO.
|
||||
# Boot the installer with:
|
||||
# linux /isolinux/vmlinuz inst.ks=http://<server>/<path>/ks.cfg
|
||||
#
|
||||
# For a local file on a USB drive, you can use:
|
||||
# linux /isolinux/vmlinuz inst.ks=hd:LABEL=<USB_LABEL>:/ks.cfg
|
||||
|
||||
# Use text mode install
|
||||
text
|
||||
|
||||
# Disable Initial Setup on first boot
|
||||
firstboot --disable
|
||||
|
||||
# Keyboard layout
|
||||
keyboard --vckeymap=us --xlayouts='us'
|
||||
|
||||
# System language
|
||||
lang en_US.UTF-8
|
||||
|
||||
# Installation source
|
||||
url --mirrorlist=https://mirrors.fedoraproject.org/mirrorlist?repo=fedora-42&arch=x86_64
|
||||
|
||||
|
||||
# Network information
|
||||
network --bootproto=dhcp --device=link --activate
|
||||
network --hostname=fedora.localdomain
|
||||
|
||||
# Root password
|
||||
rootpw $5$CXpezfLKTajPP7yI$VM8STd3QaHBTKMe2DLTmK5p.lEGbUYYZV8jGG3nxX2/ --iscrypted
|
||||
|
||||
# SELinux configuration
|
||||
selinux --enforcing
|
||||
|
||||
# Do not configure the X Window System
|
||||
skipx
|
||||
|
||||
# System timezone
|
||||
timezone US/Chicago --utc
|
||||
|
||||
# Add a user named wed
|
||||
user --groups=wheel --name=wed --password=$5$UOpZHG55fWCHlNSp$nFnpaVLb9enbQTebHo4SKBqolGr39SMYo2ZshHCe2d3 --iscrypted --gecos="wed"
|
||||
|
||||
# System bootloader configuration
|
||||
bootloader --location=mbr --append="crashkernel=auto"
|
||||
|
||||
# Clear the Master Boot Record
|
||||
zerombr
|
||||
|
||||
# Remove partitions
|
||||
clearpart --all --initlabel
|
||||
|
||||
# Automatically create partitions using LVM
|
||||
autopart --type=lvm
|
||||
|
||||
# Reboot after successful installation
|
||||
reboot
|
||||
|
||||
%packages --ignoremissing
|
||||
qemu-guest-agent
|
||||
python3-libdnf5
|
||||
#Make sure that this package gets installed because if you use DHCP this is how Promxox and then Packer will know the IP address to connect to
|
||||
#@^Infrastructure Server
|
||||
%end
|
||||
|
||||
%post --nochroot --logfile=/mnt/sysimage/root/ks-post.log
|
||||
# Disable quiet boot and splash screen
|
||||
sed --follow-symlinks -i "s/ rhgb quiet//" /mnt/sysimage/etc/default/grub
|
||||
sed --follow-symlinks -i "s/ rhgb quiet//" /mnt/sysimage/boot/grub2/grubenv
|
||||
|
||||
# Passwordless sudo for the user 'wed'
|
||||
echo "wed ALL=(ALL) NOPASSWD: ALL" >> /mnt/sysimage/etc/sudoers.d/wed
|
||||
%end
|
||||
0
packer/ubuntu-24.04/http/meta-data
Normal file
0
packer/ubuntu-24.04/http/meta-data
Normal file
51
packer/ubuntu-24.04/http/user-data
Normal file
51
packer/ubuntu-24.04/http/user-data
Normal file
@@ -0,0 +1,51 @@
|
||||
#cloud-config
|
||||
autoinstall:
|
||||
version: 1
|
||||
|
||||
source:
|
||||
id: ubuntu-server
|
||||
|
||||
ssh:
|
||||
install-server: true
|
||||
allow-pw: true
|
||||
disable_root: true
|
||||
# ssh_quiet_keygen: true
|
||||
# allow_public_ssh_keys: true
|
||||
|
||||
ssh_pwauth: true
|
||||
|
||||
locale: en_US.UTF-8
|
||||
keyboard:
|
||||
layout: us
|
||||
|
||||
refresh-installer:
|
||||
update: true
|
||||
|
||||
packages:
|
||||
- qemu-guest-agent
|
||||
- chrony
|
||||
|
||||
storage:
|
||||
layout:
|
||||
name: lvm # direct
|
||||
policy: all
|
||||
# swap:
|
||||
# filename: /swap.img
|
||||
# size: auto
|
||||
|
||||
user-data:
|
||||
disable_root: true
|
||||
package_upgrade: false
|
||||
timezone: America/Chicago
|
||||
users:
|
||||
- name: wed
|
||||
primary-group: users
|
||||
groups: sudo
|
||||
lock_passwd: false # true
|
||||
passwd: "$6$KuJJYQtKFO02HoEG$AzpYknAjxx1E7LqH.T3eZou5rgQ2RTkxstHwuRaXflT6ZN2NPPS0SiD/F.KdZmz4A3/OR2VNmfoSzuoYwzdfT."
|
||||
shell: /bin/bash
|
||||
ssh_authorized_keys:
|
||||
- ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINnSM/9fO8rz/amqkyoGUzUKNNzzmtSXPwOCr1O9zKNO ansible
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
|
||||
shutdown: reboot
|
||||
41
packer/ubuntu-24.04/http/user-data-v2
Normal file
41
packer/ubuntu-24.04/http/user-data-v2
Normal file
@@ -0,0 +1,41 @@
|
||||
#cloud-config
|
||||
autoinstall:
|
||||
version: 1
|
||||
early-commands:
|
||||
# Stop ssh for packer
|
||||
- sudo systemctl stop ssh
|
||||
locale: en_US
|
||||
keyboard:
|
||||
layout: us
|
||||
identity:
|
||||
hostname: ubuntu-server
|
||||
username: wed
|
||||
password: '$1$Cc71g3Aa$WUMTLZg7B94dhHdxT7J/P/'
|
||||
ssh:
|
||||
install-server: yes
|
||||
allow-pw: yes
|
||||
storage:
|
||||
layout:
|
||||
name: lvm
|
||||
apt:
|
||||
geoip: true
|
||||
primary:
|
||||
- arches: [i386, amd64]
|
||||
uri: "http://archive.ubuntu.com/ubuntu"
|
||||
# packages:
|
||||
# - curl
|
||||
# - unzip
|
||||
# - openssh-server
|
||||
# - util-linux-extra
|
||||
# - qemu-guest-agent
|
||||
# - cloud-init
|
||||
user-data:
|
||||
disable_root: false
|
||||
late-commands:
|
||||
- sed -i -e 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /target/etc/ssh/sshd_config
|
||||
- sed -i -e 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /target/etc/ssh/sshd_config
|
||||
- echo 'wed ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/wed
|
||||
- curtin in-target --target=/target -- vmware-toolbox-cmd config set deployPkg enable-custom-scripts true
|
||||
- curtin in-target --target=/target -- chmod 440 /etc/sudoers.d/wed
|
||||
- curtin in-target --target=/target -- apt-get update
|
||||
- curtin in-target --target=/target -- apt-get upgrade --yes
|
||||
Reference in New Issue
Block a user