Commit 77c862e8 authored by Your Name's avatar Your Name
Browse files

lint

parent 870e70f6
......@@ -6,26 +6,26 @@ define hypervisor::network (
$dns = undef,
) {
alert($name)
libvirt::network { "$name":
libvirt::network { $name:
forward_mode => 'bridge',
bridge => "$name",
bridge => $name,
}
# configures hypervisor as the gateway for now
network::interface { "$name":
network::interface { $name:
bridge_ports => ['none'],
bridge_stp => 'off',
bridge_fd => 0,
address => $gateway,
address => $gateway,
netmask => $netmask,
}
}
......
......@@ -3,14 +3,14 @@
#
class hypervisor::networks (
String $domain = lookup("domain", undef, undef, "no_domain_set"),
String $domain = lookup('domain', undef, undef, 'no_domain_set'),
) {
require put::buster
require put::base
include network
#packages
......
......@@ -36,12 +36,12 @@ class hypervisor::router::vm ()
Exec { "/usr/local/bin/mkrootdisk.sh /dev/${hypervisor::vm::root_vg}/router-disk":
require => [ File['/usr/local/bin/mkrootdisk.sh'], File['/usr/local/bin/inodecount.sh'], Lvm::Logical_volume['router-disk'] ],
onlyif => "/usr/bin/test `/usr/local/bin/inodecount.sh /dev/${hypervisor::vm::root_vg}/router-disk` = 11",
environment => ["INTIP=$int_ip",
"INTNM=$int_netmask",
"EXTIP=$ext_ip",
"EXTGW=1.2.3.4",
"EXTNM=$ext_netmask",
"DNS=$int_dns",
environment => ["INTIP=${int_ip}",
"INTNM=${int_netmask}",
"EXTIP=${ext_ip}",
'EXTGW=1.2.3.4',
"EXTNM=${ext_netmask}",
"DNS=${int_dns}",
'VMNAME=router',
"AUTHKEY=${hypervisor::vm::authorized_key}"],
timeout => 0,
......@@ -55,12 +55,12 @@ class hypervisor::router::vm ()
devices_profile => 'headless',
dom_profile => 'myprofile',
uuid => hypervisor_generate_uuid($name),
disks => [{'type' => 'block',
'device' => 'disk',
'source' => {'dev' => "/dev/${hypervisor::vm::root_vg}/router-disk"},
'bus' => 'virtio',
'driver' => {'name' => 'qemu',
uuid => hypervisor_generate_uuid($name),
disks => [{'type' => 'block',
'device' => 'disk',
'source' => {'dev' => "/dev/${hypervisor::vm::root_vg}/router-disk"},
'bus' => 'virtio',
'driver' => {'name' => 'qemu',
'type' => 'raw',
'cache' => 'directsync',
},
......@@ -74,7 +74,7 @@ class hypervisor::router::vm ()
'cache' => 'directsync',
},
},],
interfaces => [ {
interfaces => [ {
'network' => 'internal',
'mac' => '52:54:00:ac:ab:01',
'type' => 'virtio',
......@@ -89,8 +89,8 @@ class hypervisor::router::vm ()
'name' => 'router-ext'
},
],
autostart => true,
require => Exec["/usr/local/bin/mkrootdisk.sh /dev/${hypervisor::vm::root_vg}/router-disk"],
autostart => true,
require => Exec["/usr/local/bin/mkrootdisk.sh /dev/${hypervisor::vm::root_vg}/router-disk"],
}
}
......@@ -10,7 +10,7 @@ class hypervisor::vm (
# String $kernel = '/etc/xen/boot/stable.vmlinuz',
# String $initrd = undef,
String $authorized_key = 'none',
String $domain = lookup("domain", undef, undef, "no_domain_set"),
String $domain = lookup('domain', undef, undef, 'no_domain_set'),
) {
......
......@@ -4,7 +4,7 @@
define hypervisor::vm::deploy (
$ensure = 'present',
String $domain = lookup("domain", undef, undef, "nodomainset.la"),
String $domain = lookup('domain', undef, undef, 'nodomainset.la'),
Stdlib::Fqdn $public_hostname = "${name}.${domain}",
String $rootsize = '4G',
String $swapsize = '1G',
......@@ -134,36 +134,36 @@ define hypervisor::vm::deploy (
}
exec { "restart_${name}":
command => "/usr/bin/virsh shutdown ${name} ; /usr/bin/virsh define /etc/libvirt/qemu/${name}.xml ; /usr/bin/virsh start ${ name } ",
subscribe => [
File["/etc/libvirt/qemu/${name}.xml"],
command => "/usr/bin/virsh shutdown ${name} ; /usr/bin/virsh define /etc/libvirt/qemu/${name}.xml ; /usr/bin/virsh start ${ name } ",
subscribe => [
File["/etc/libvirt/qemu/${name}.xml"],
],
require => [
Libvirt::Domain["${name}"],
require => [
Libvirt::Domain[$name],
],
refreshonly => true,
}
file { "/etc/libvirt/qemu/${name}.xml":
audit => 'content',
audit => 'content',
notify => Exec["restart_${name}"],
}
libvirt::domain { $name:
devices_profile => 'headless',
dom_profile => 'myprofile',
boot => 'hd',
disks => hypervisor_disks($name,$hypervisor::vm::root_vg,$hypervisor::vm::swap_vg,$hypervisor::vm::data_vg,$datadisk),
interfaces => hypervisor_interfaces($name,$internal_ip,$internal_mac,$external_ip,$external_mac,$external_net,$internal_method,$external_method),
autostart => $autostart,
require => [ Exec["/usr/local/bin/mkrootdisk.sh /dev/${hypervisor::vm::root_vg}/${name}-disk"],
boot => 'hd',
disks => hypervisor_disks($name,$hypervisor::vm::root_vg,$hypervisor::vm::swap_vg,$hypervisor::vm::data_vg,$datadisk),
interfaces => hypervisor_interfaces($name,$internal_ip,$internal_mac,$external_ip,$external_mac,$external_net,$internal_method,$external_method),
autostart => $autostart,
require => [ Exec["/usr/local/bin/mkrootdisk.sh /dev/${hypervisor::vm::root_vg}/${name}-disk"],
Exec["delete old ${name} config"],
#hypervisor::network["${internal_net}"],
#hypervisor::network["${external_net}"],
Libvirt::Nwfilter["${name}-internal"],
Libvirt::Nwfilter["${name}-external"] ],
uuid => hypervisor_generate_uuid($name),
uuid => hypervisor_generate_uuid($name),
}
......
......@@ -3,7 +3,7 @@
#
class hypervisor::vms (
String $domain = lookup("domain", undef, undef, "no_domain_set"),
String $domain = lookup('domain', undef, undef, 'no_domain_set'),
) {
......@@ -19,7 +19,7 @@ class hypervisor::vms (
buildkernel::kernel { 'test2':
kernel_version => '4.19.0-9-cloud-amd64',
kernel_type => 'debian',
kernel_type => 'debian',
}
# create vm's defined in hiera
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment