added frontend vm
This commit is contained in:
parent
eda42a2263
commit
f8098d4d9a
2 changed files with 73 additions and 0 deletions
|
@ -20,6 +20,14 @@ jmp.komreg.net:
|
|||
konsulter:
|
||||
autoupdate:
|
||||
|
||||
kvmfe-fre-3.komreg.net:
|
||||
eid::cloudimage:
|
||||
fe-fre-3.komreg.net:
|
||||
mac: '52:54:20:01:00:01'
|
||||
description: 'eid fre frontend'
|
||||
cpus: '4'
|
||||
memory: '4096'
|
||||
|
||||
nic.komreg.net:
|
||||
sunet_iaas_cloud:
|
||||
autoupdate:
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
# Wrapper with eid common settings for sunet::cloudimage
|
||||
class eid::cloudimage(
|
||||
String $mac,
|
||||
String $cpus = '1',
|
||||
String $memory = '1024',
|
||||
String $description = undef,
|
||||
Boolean $dhcp = true,
|
||||
Optional[String] $ip = undef,
|
||||
Optional[String] $netmask = undef,
|
||||
Optional[String] $gateway = undef,
|
||||
Optional[String] $ip6 = undef,
|
||||
Optional[String] $netmask6 = '64',
|
||||
Optional[String] $gateway6 = undef,
|
||||
Optional[Array] $resolver = undef,
|
||||
Array[String] $search = ['komreg.net'],
|
||||
String $bridge = 'br0',
|
||||
String $size = '40G',
|
||||
String $local_size = '0',
|
||||
String $image_url = 'https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img',
|
||||
) {
|
||||
# This is a hack, use SSH keys from KVM host?
|
||||
$ft_ssh_key = hiera('ssh_authorized_keys')['mariah+CA747E57@nordu.net']
|
||||
$cloudimage_ssh_keys = [sprintf('%s %s %s', $ft_ssh_key['type'], $ft_ssh_key['key'], $ft_ssh_key['name'])]
|
||||
|
||||
$_v6_resolver = $ip6 ? {
|
||||
undef => undef,
|
||||
default => ['2001:6b0:1e::14',
|
||||
'2001:6b0:1e::99',
|
||||
],
|
||||
}
|
||||
|
||||
$_resolver1 = pick($resolver, $_v6_resolver, 'NOT_SET')
|
||||
$_resolver = $_resolver1 ? {
|
||||
'NOT_SET' => undef,
|
||||
default => $_resolver1,
|
||||
}
|
||||
|
||||
sunet::cloudimage { $name:
|
||||
image_url => $image_url,
|
||||
ssh_keys => $cloudimage_ssh_keys,
|
||||
apt_dir => '/etc/cosmos/apt',
|
||||
disable_ec2 => true,
|
||||
#
|
||||
bridge => $bridge,
|
||||
dhcp => $dhcp,
|
||||
mac => $mac,
|
||||
ip => $ip,
|
||||
netmask => $netmask,
|
||||
gateway => $gateway,
|
||||
ip6 => $ip6,
|
||||
netmask6 => $netmask6,
|
||||
gateway6 => $gateway6,
|
||||
resolver => $_resolver,
|
||||
search => $search,
|
||||
#
|
||||
repo => $::cosmos_repo_origin_url,
|
||||
tagpattern => $::cosmos_tag_pattern,
|
||||
#
|
||||
cpus => $cpus,
|
||||
memory => $memory,
|
||||
description => $description,
|
||||
size => $size,
|
||||
local_size => $local_size,
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue