Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #38229 - Add new template snapshot host for Ubuntu #10451

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions app/services/foreman/template_snapshot_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ def self.ubuntu_autoinst4dhcp
new.ubuntu_autoinst4dhcp
end

def self.ubuntu_autoinstmulti4dhcp
new.ubuntu_autoinstmulti4dhcp
end

def self.rhel9_dhcp
new.rhel9_dhcp
end
Expand Down Expand Up @@ -187,6 +191,22 @@ def ubuntu_autoinst4dhcp
define_host_params(host)
end

def ubuntu_autoinstmulti4dhcp
nic_a = FactoryBot.build(:nic_primary_and_provision, identifier: '',
mac: '00-f0-54-1a-7e-e0',
ip: '192.168.42.42')
nic_b = FactoryBot.build(:nic_managed, identifier: '',
mac: '00-f0-54-1a-7e-e1',
ip: '192.168.42.43')

host = FactoryBot.build(:host_for_snapshots_ipv4_dhcp_ubuntu20,
name: 'snapshot-ipv4-dhcp-ubuntu20',
subnet: FactoryBot.build(:subnet_ipv4_dhcp_for_snapshots),
interfaces: [nic_a, nic_b])
host.define_singleton_method(:managed_interfaces) { interfaces }
define_host_params(host)
end

def rhel9_dhcp
host = FactoryBot.build(:host_for_snapshots_ipv4_dhcp_rhel9,
name: 'snapshot-ipv4-dhcp-rhel9',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ oses:
- ubuntu
test_on:
- ubuntu_autoinst4dhcp
- ubuntu_autoinstmulti4dhcp
description: |
The provisioning template for Autoinstall based distributions. To customize the installation,
modify the host parameters
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#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
user-data:
disable_root: false
fqdn: snapshot-ipv4-dhcp-ubuntu20
users:
- name: root
gecos: root
lock_passwd: false
hashed_passwd: $1$rtd8Ub7R$5Ohzuy8WXlkaK9cA2T1wb0
keyboard:
layout: us
toggle: null
variant: ''
locale: en_US.UTF-8
network:
version: 2
ethernets:
id0:
match:
macaddress: "00-f0-54-1a-7e-e0"
dhcp4: true
dhcp6: false
id0:
match:
macaddress: "00-f0-54-1a-7e-e0"
dhcp4: false
dhcp6: false
ssh:
allow-pw: true
install-server: true
updates: security
storage:
layout:
name: lvm

late-commands:

- wget --no-proxy http://foreman.example.com/unattended/finish -O /target/tmp/finish.sh
- curtin in-target -- chmod +x /tmp/finish.sh
- curtin in-target -- /tmp/finish.sh
Loading