Problem:
Attempting to auto install (unattended) Ubuntu 20.04/22.04 LTS hosts with foreman (3.3.0.20) packaged with Red Hat Satellite 6.12.2. I have everything working with iPXE at this point to load the iso, however it does not seem to be using my user data template. Please see my templates below:
Preseed_default_iPXE_2004 - AUTOINSTALL - template
#!gpxe
<%#
kind: iPXE
name: Preseed_default_iPXE_2004 - AUTOINSTALL
model: ProvisioningTemplate
oses:
- Debian
- Ubuntu
%>
<% if @host.operatingsystem.name == 'Debian' -%>
<%- keyboard_params = "auto=true domain=#{@host.domain}" -%>
<% else -%>
<%- keyboard_params = 'console-setup/ask_detect=false console-setup/layout=USA console-setup/variant=USA keyboard-configuration/layoutcode=us' -%>
<% end -%>
<% subnet = @host.subnet -%>
<% if subnet.nil? || subnet.dhcp_boot_mode? -%>
<%- provision_url_suffix = '' -%>
<%- netcfg_args = '' -%>
<% else -%>
<%- provision_url_suffix = (@host.token.nil? ? '?' : '&') + 'static=yes' -%>
<%- netcfg_args = 'netcfg/disable_dhcp=true netcfg/get_ipaddress=${netX/ip} netcfg/get_netmask=${netX/netmask} netcfg/get_gateway=${netX/gateway} netcfg/get_nameservers=${dns} netcfg/confirm_static=true' -%>
<% end -%>
set gfxpayload=keep
kernel /pub/installation_media/ubuntu/20.04-x86_64/casper/vmlinuz
initrd /pub/installation_media/ubuntu/20.04-x86_64/casper/initrd
imgargs vmlinuz ramdisk_size=10800 initrd=initrd boot=casper maybe-ubiquity verbose url=http://<mirror_URL>/provisioning/ubuntu/20.04/ubuntu-20.04.6-live-server-amd64.iso ip=dhcp cloud-config-url=/dev/null autoinstall ds=nocloud-net;s=http://<%= foreman_request_addr %>/userdata/
boot
Preseed Autoinstall cloud-init user data - template
<%#
kind: user_data
name: Preseed Autoinstall cloud-init user data
model: ProvisioningTemplate
oses:
- ubuntu
test_on:
- ubuntu_autoinst4dhcp
-%>
<%-
username_to_create = host_param('username_to_create', 'root')
realname_to_create = host_param('realname_to_create') || username_to_create
password_to_create = host_param('password_to_create') || @host.root_pass
host_interface = @host.provision_interface
host_mac = @host.mac
-%>
#cloud-config
autoinstall:
version: 1
apt:
geoip: false
preserve_sources_list: false
primary:
- arches: [amd64, i386]
uri: http://archive.ubuntu.com/ubuntu
- arches: [default]
uri: http://ports.ubuntu.com/ubuntu-ports
users:
- { name: user1, gecos: Administrator, primary_group: sudo, passwd:<hashed_Pass>, shell: /bin/bash, homedir: /home/user1 }
- { name: user2, gecos: Provisioning Admin, sudo: ALL=(root) /bin/apt, /bin/usermod, /bin/adjoin, /bin/adleave, /bin/df, /sbin/fdisk -l, passwd:<hashed_Pass>, shell: /bin/bash, homedir: /home/user2 }
<%= indent(4) { snippet_if_exists(template_name + " custom apt") } -%>
identity:
hostname: <%= @host.name %>
realname: <%= realname_to_create %>
username: <%= username_to_create %>
password: "<%= password_to_create %>"
keyboard: {layout: us, toggle: null, variant: ''}
locale: en_US.UTF-8
packages:
- aide
- ubuntu-desktop
- cifs-utils
- at
- kexec-tools
- perl
- -gnome-boxes
- -tuned
<%= snippet 'preseed_netplan_setup' -%>
ssh:
allow-pw: true
authorized-keys: []
install-server: true
updates: security
network:
version: 1
config:
- type: physical
name: <% host_interface %>
mac_address: <% host_mac %>
subnets:
- type: dhcp
<%= indent(2) { @host.diskLayout } -%>
<%= indent(2) { snippet_if_exists(template_name + " custom root") } -%>
user-data:
runcmd:
- wget -Y off <%= @static ? "'#{foreman_url('finish', static: 'true')}'" : foreman_url('finish') %> -O /tmp/finish.sh
- chmod +x /tmp/finish.sh
- /tmp/finish.sh
Expected outcome:
Unattended provisioning of Ubuntu 20.04 and 22.04 LTS Desktops using iPXE from foreman.
Foreman and Proxy versions:
- foreman-3.3.0.20-1.el8sat.noarch
- foreman-proxy-3.3.0-1.el8sat.noarch
Foreman and Proxy plugin versions:
- foreman-tasks: 6.0.3
- foreman_ansible: 7.1.4.1
- foreman_azure_rm: 2.2.6
- foreman_bootdisk: 19.0.7
- foreman_discovery: 21.0.5
- foreman_hooks: 0.3.17
- foreman_leapp: 0.1.10
- foreman_openscap: 5.2.2
- foreman_remote_execution: 7.2.2
- foreman_rh_cloud: 6.0.44
- foreman_templates: 9.3.0
- foreman_theme_satellite: 10.0.0.4
- foreman_virt_who_configure: 0.5.9
- foreman_webhooks: 3.0.5
- katello: 4.5.0.24
Distribution and version:
Foreman: Red Hat Satellite version 6.12.2
- foreman-3.3.0.20-1.el8sat.noarch
- foreman-proxy-3.3.0-1.el8sat.noarch
Hosts to deploy:
- Red Hat Enterprise Linux 8 = Working
- Ubuntu 20.04 LTS = kicks off the ISO for manual installation, not accepting user-data
- Ubuntu 22.04 LTS = kicks off the ISO for manual installation, not accepting user-data
Other relevant data:
Due to sensitivity, I am required to redact any business sensitive content. I am happy to provide any needed data that may help resolve this. Due to the mass scale of system provisioning, with limited Linux experience in my Desktop department I am required to have an automated solution in place. Due to the switch from preseed to subiquity/cloud-init I have to implement a new process with a short time line.
I would like assistance to determine if I am missing a step as this seem to be undocumented, aside from creating the installation media, which I did following steps found here:
2.5. Creating an Operating System for Ubuntu
I have my ISO file hosted on an internal mirror server, this seems to work. The issue is that as soon as the ISO kicks off, it brings me to a menu asking to setup the keyboard, languge, etc. This should not be the case, as I am using the foreman’s user-data template, with some modifications, and autoinstall is suppose to complete regardless of input.
I thank you for any assistance in advance, as this is a high priority for my organization.
Thanks,
Joe