Problem:
I have been trying to install Ubuntu 20.04.6 with cloud-init via user data and it feels like that the user data script just isn’t being passed over to the machine I’m trying to build as it always brings me into the language prompt. I tried manually creating cloud-init user-data and meta-data files and that seems to work, but when I try copy-pasting what is in the manually created user-data into a Foreman userdata script it doesn’t seem to pass over and brings me over to the language prompt instead of auto-installing. I would like an output somewhere in the Foreman host machine of the generated userdata script like what shows in the preview window of the template.
Expected outcome:
Somewhere on the Foreman host machine there should be an output of the generated userdata script.
Foreman and Proxy versions:
Foreman 3.5.1.17‑1
Foreman and Proxy plugin versions:
ansible-collection-redhat-satellite-3.9.0-2.el8sat.noarch
ansible-collection-redhat-satellite_operations-1.3.0-2.el8sat.noarch
ansiblerole-foreman_scap_client-0.2.0-2.el8sat.noarch
candlepin-4.2.13-1.el8sat.noarch
candlepin-selinux-4.2.13-1.el8sat.noarch
foreman-3.5.1.17-1.el8sat.noarch
foreman-bootloaders-redhat-202102220000-1.el8sat.noarch
foreman-bootloaders-redhat-tftpboot-202102220000-1.el8sat.noarch
foreman-cli-3.5.1.17-1.el8sat.noarch
foreman-debug-3.5.1.17-1.el8sat.noarch
foreman-dynflow-sidekiq-3.5.1.17-1.el8sat.noarch
foreman-ec2-3.5.1.17-1.el8sat.noarch
foreman-installer-3.5.2.1-1.el8sat.noarch
foreman-installer-katello-3.5.2.1-1.el8sat.noarch
foreman-libvirt-3.5.1.17-1.el8sat.noarch
foreman-obsolete-packages-1.1-1.el8sat.noarch
foreman-openstack-3.5.1.17-1.el8sat.noarch
foreman-ovirt-3.5.1.17-1.el8sat.noarch
foreman-postgresql-3.5.1.17-1.el8sat.noarch
foreman-proxy-3.5.1-1.el8sat.noarch
foreman-selinux-3.5.1-1.el8sat.noarch
foreman-service-3.5.1.17-1.el8sat.noarch
foreman-vmware-3.5.1.17-1.el8sat.noarch
katello-4.7.0-1.el8sat.noarch
katello-certs-tools-2.9.0-1.el8sat.noarch
katello-client-bootstrap-1.7.9-1.el8sat.noarch
katello-common-4.7.0-1.el8sat.noarch
katello-debug-4.7.0-1.el8sat.noarch
katello-selinux-4.0.2-2.el8sat.noarch
pulpcore-selinux-1.3.2-1.el8pc.x86_64
puppet-foreman_scap_client-0.4.0-1.el8sat.noarch
python39-pulp-ansible-0.15.0-1.el8pc.noarch
python39-pulp-certguard-1.5.5-1.el8pc.noarch
python39-pulp-cli-0.14.0-4.el8pc.noarch
python39-pulp-container-2.14.3-1.el8pc.noarch
python39-pulp-file-1.11.1-1.el8pc.noarch
python39-pulp-rpm-3.18.14-1.el8pc.noarch
python39-pulpcore-3.21.6-1.el8pc.noarch
qpid-proton-c-0.33.0-4.el8.x86_64
rubygem-foreman-tasks-7.2.1-1.el8sat.noarch
rubygem-foreman_ansible-10.4.0-1.el8sat.noarch
rubygem-foreman_azure_rm-2.2.7-1.el8sat.noarch
rubygem-foreman_bootdisk-21.0.3-1.1.el8sat.noarch
rubygem-foreman_discovery-22.0.2-1.1.el8sat.noarch
rubygem-foreman_google-1.0.3-1.el8sat.noarch
rubygem-foreman_hooks-0.3.17-3.1.el8sat.noarch
rubygem-foreman_leapp-0.1.13-1.el8sat.noarch
rubygem-foreman_maintain-1.2.8-1.el8sat.noarch
rubygem-foreman_openscap-5.2.3-1.el8sat.noarch
rubygem-foreman_puppet-5.0.0-1.el8sat.noarch
rubygem-foreman_remote_execution-8.3.0-1.el8sat.noarch
rubygem-foreman_rh_cloud-7.0.45-1.el8sat.noarch
rubygem-foreman_templates-9.3.0-2.1.el8sat.noarch
rubygem-foreman_theme_satellite-11.0.0.5-1.el8sat.noarch
rubygem-foreman_virt_who_configure-0.5.13-1.el8sat.noarch
rubygem-foreman_webhooks-3.0.5-1.1.el8sat.noarch
rubygem-hammer_cli-3.5.1-1.el8sat.noarch
rubygem-hammer_cli_foreman-3.5.1-1.el8sat.noarch
rubygem-hammer_cli_foreman_admin-1.1.0-1.el8sat.noarch
rubygem-hammer_cli_foreman_ansible-0.4.0-2.el8sat.noarch
rubygem-hammer_cli_foreman_azure_rm-0.2.2-1.el8sat.noarch
rubygem-hammer_cli_foreman_bootdisk-0.3.0-3.el8sat.noarch
rubygem-hammer_cli_foreman_discovery-1.1.0-1.el8sat.noarch
rubygem-hammer_cli_foreman_google-1.0.0-1.el8sat.noarch
rubygem-hammer_cli_foreman_openscap-0.1.13-2.el8sat.noarch
rubygem-hammer_cli_foreman_puppet-0.0.6-1.el8sat.noarch
rubygem-hammer_cli_foreman_remote_execution-0.2.2-1.el8sat.noarch
rubygem-hammer_cli_foreman_tasks-0.0.18-1.el8sat.noarch
rubygem-hammer_cli_foreman_templates-0.2.0-3.el8sat.noarch
rubygem-hammer_cli_foreman_virt_who_configure-0.0.9-2.el8sat.noarch
rubygem-hammer_cli_foreman_webhooks-0.0.4-1.el8sat.noarch
rubygem-hammer_cli_katello-1.7.3-1.el8sat.noarch
rubygem-katello-4.7.0.25-1.el8sat.noarch
rubygem-pulp_ansible_client-0.15.0-1.el8sat.noarch
rubygem-pulp_certguard_client-1.5.5-1.el8sat.noarch
rubygem-pulp_container_client-2.14.2-1.el8sat.noarch
rubygem-pulp_deb_client-2.20.0-1.el8sat.noarch
rubygem-pulp_file_client-1.11.2-1.el8sat.noarch
rubygem-pulp_ostree_client-2.0.0-0.1.a1.el8sat.noarch
rubygem-pulp_python_client-3.7.3-1.el8sat.noarch
rubygem-pulp_rpm_client-3.18.7-1.el8sat.noarch
rubygem-pulpcore_client-3.21.2-1.el8sat.noarch
rubygem-qpid_proton-0.33.0-5.el8sat.x86_64
rubygem-smart_proxy_pulp-3.2.0-3.el8sat.noarch
satellite-6.13.1-1.el8sat.noarch
satellite-cli-6.13.1-1.el8sat.noarch
satellite-common-6.13.1-1.el8sat.noarch
satellite-installer-6.13.0.7-1.el8sat.noarch
satellite-maintain-0.0.1-1.el8sat.noarch
Other relevant data:
It does not appear I have the foreman-userdata plugin. I do not know if this is crucial or not to my issue. Additionally, I am using Red Hat Satellite, but I figured to ask here since it pretty much is Foreman.
NOTE: I intentionally set the password to N/A specifically for this post.
iPXE Template
#!gpxe
<%#
kind: iPXE
name: Preseed default iPXE
model: ProvisioningTemplate
oses:
- Debian
- Ubuntu
test_on:
- debian4dhcp
- ubuntu4dhcp
description: |
The template to render iPXE installation script for preseed based distributions
The output is deployed on the host's subnet TFTP proxy.
See https://ipxe.org/scripting for more details
-%>
<%
iface = @host.provision_interface
subnet4 = iface.subnet
subnet6 = iface.subnet6
if subnet4 && !subnet4.dhcp_boot_mode?
url = foreman_url('provision', static: '1')
elsif subnet6 && !subnet6.dhcp_boot_mode?
url = foreman_url('provision', static6: '1')
else
url = foreman_url('provision')
end
-%>
echo Trying to ping Gateway: ${netX/gateway}
ping --count 1 ${netX/gateway} || echo Ping to Gateway failed or ping command not available.
echo Trying to ping DNS: ${netX/dns}
ping --count 1 ${netX/dns} || echo Ping to DNS failed or ping command not available.
<% boot_files_uris = @host.operatingsystem.boot_files_uri(medium_provider) -%>
<% kernel = boot_files_uris[0] -%>
<% initrd = boot_files_uris[1] -%>
kernel <%= kernel %> initrd=initrd interface=auto cloud-config-url=<%= '/dev/null' %> url=<%='https://releases.ubuntu.com/focal/ubuntu-20.04.6-live-server-amd64.iso'%> autoinstall ramdisk_size=10800 root=/dev/rd/0 rw auto BOOTIF=01-${netX/mac:hexhyp} <%= snippet("preseed_kernel_options").strip %>
initrd <%= initrd %>
imgstat
sleep 2
boot
user-data script
#cloud-config
autoinstall:
apt:
disable_components: []
fallback: abort
geoip: true
mirror-selection:
primary:
- country-mirror
- arches:
- amd64
- i386
uri: http://archive.ubuntu.com/ubuntu
- arches:
- s390x
- arm64
- armhf
- powerpc
- ppc64el
- riscv64
uri: http://ports.ubuntu.com/ubuntu-ports
preserve_sources_list: false
codecs:
install: false
drivers:
install: false
identity:
hostname: testsystem
password: N/A
realname: test
username: test
kernel:
package: linux-generic
keyboard:
layout: us
toggle: null
variant: ''
locale: en_US.UTF-8
network:
ethernets:
eno1:
dhcp4: true
version: 2
source:
id: synthesized
search_drivers: false
ssh:
allow-pw: true
authorized-keys: []
install-server: true
storage:
config:
- ptable: gpt
serial: ST3500620AS_9QMAG18Z
wwn: '0x5000c50010e3daa1'
path: /dev/sda
wipe: superblock-recursive
preserve: false
name: ''
grub_device: false
type: disk
id: disk-sda
- device: disk-sda
size: 1127219200
wipe: superblock
flag: boot
number: 1
preserve: false
grub_device: true
offset: 1048576
path: /dev/sda1
type: partition
id: partition-0
- fstype: fat32
volume: partition-0
preserve: false
type: format
id: format-0
- device: disk-sda
size: 498978521088
wipe: superblock
number: 2
preserve: false
grub_device: false
offset: 1128267776
path: /dev/sda2
type: partition
id: partition-1
- fstype: ext4
volume: partition-1
preserve: false
type: format
id: format-1
- path: /
device: format-1
type: mount
id: mount-1
- path: /boot/efi
device: format-0
type: mount
id: mount-0
updates: security
version: 1