Skip to content

Instantly share code, notes, and snippets.

@igalic
Last active December 31, 2015 00:39
Show Gist options
  • Save igalic/7909304 to your computer and use it in GitHub Desktop.
Save igalic/7909304 to your computer and use it in GitHub Desktop.
# bacon is a KVM Host.
---
# These IP addresses are needed to setup virbr1
#
# n.b.: We can't use facter for these values because as soon as we start
# managing /etc/network/interfaces the "facts will change".. in a way..
#
kvmhost::ip: 176.9.39.38
kvmhost::netmask: 255.255.255.224
kvmhost::gateway: 176.9.39.33
kvmhost::network: 176.9.39.32
kvmhost::broadcast: 176.9.39.63
# please supply the IPv6 base-address without trailing `::'.
# This is because we use it for magically create networks
kvmhost::ipv6: 2a01:4f8:150:5024
kvmhost::ipv6_gateway: fe80::1
# On bacon we'll host the following Virtual Machines
cobblersystems:
# pgdb01.esat
pgdb01.esat:
profile: internal
interfaces:
eth0:
ip_address: 192.168.122.11
ipv6_address: "%{kvmhost::ipv6}::10:11"
mydb02.esat:
profile: internal
interfaces:
eth0:
ip_address: 192.168.122.12
ipv6_address: "%{kvmhost::ipv6}::10:12"
# Puppet Master, now Internal and IPv6 only!
ppmaster02.esat:
profile: internal
interfaces:
eth0:
ip_address: 192.168.122.124
ipv6_address: "%{kvmhost::ipv6}::10:124"
# Proxy01
proxy01.esotericsystems.at:
profile: external
hostname: proxy01.esat
gateway: 176.9.135.31
interfaces:
eth1:
mac_address: '00:50:56:00:50:46'
ip_address: 176.9.135.27
virt_bridge: virbr1
eth0:
ip_address: 192.168.122.51
ipv6_address: "%{kvmhost::ipv6}::10:51"
# GitLab
git01.esotericsystems.at:
profile: external
hostname: git01.esat
gateway: 176.9.55.233
interfaces:
eth1:
mac_address: '00:50:56:00:4F:72'
ip_address: 176.9.55.235
virt_bridge: virbr1
eth0:
ip_address: 192.168.122.123
ipv6_address: "%{kvmhost::ipv6}::10:123"
# == Class: kvmhost::config::cobbler
#
# This class is the global hook for configuration of cobbler
# Here we'll setup our repos and distros and other funk!
#
# === Parameters
#
# === Variables
#
# === Examples
#
# include 'kvmhost::config::cobbler'
#
# === Authors
#
# Brainsware <[email protected]>
#
# === Copyright
#
# Copyright 2013 Brainsware
#
class kvmhost::config::cobbler inherits kvmhost {
$cobblerdistros = hiera ('cobblerdistros', {})
$distrodefaults = { 'destdir' => $::cobbler::distro_path }
if $cobblerdistros {
create_resources('cobblerdistro', $cobblerdistros, $distrodefaults)
}
$cobblerprofiles = hiera('cobblerprofiles', {})
$profiledefaults = {
'nameservers' => [
'176.9.94.130', '213.133.99.99', '213.133.100.100',
'2a01:4f8:0:a0a1::add:1010', '2a01:4f8:0:a111::add:9898', '2a01:4f8:0:a102::add:9999',
],
'virt_path' => 'vg0',
'virt_file_size' => '80',
'virt_type' => 'kvm',
'virt_auto_boot' => true,
'repos' => [],
'search' => [ 'esat.' ],
}
if $cobblerprofiles {
create_resources('cobblerprofile', $cobblerprofiles, $profiledefaults)
}
$cobblersystems = hiera('cobblersystems', {})
$systemdefaults = {
'power_type' => 'virsh',
'gateway' => '192.168.122.1',
'interfaces' => {
'eth0' => {
'netmask' => '255.255.255.0',
'ipv6_default_gateway' => "${kvmhost::ipv6}::10:1",
}
}
}
if $cobblersystems {
create_resources('cobblersystem', $cobblersystems, $systemdefaults)
}
}
---
:backends:
- yaml
:yaml:
:datadir: /etc/puppet/environment/%{environment}/hieradata
:logger: console
:merge_behavior: deeper
:hierarchy:
- "%{clientcert}"
- "roles/%{role}"
- "services/%{service}"
- "services/%{service}/%{customer}"
- "services/%{service}/%{projects}"
- "common"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment