"manifests/base/manifests/base/zfs.pp" did not exist on "0072a96c77992a0b4880b893f41816bedeb72ea2"
Commit 70b2da96 authored by James T. Lee's avatar James T. Lee
Browse files

Refactor base and workstation profile

parent 60062bcc
class nest::profile::base { class nest::base {
contain '::nest::profile::base::puppet' contain '::nest::base::puppet'
contain '::nest::profile::base::git' contain '::nest::base::git'
contain '::nest::profile::base::packages' contain '::nest::base::packages'
contain '::nest::profile::base::qemu' contain '::nest::base::qemu'
contain '::nest::profile::base::ssh' contain '::nest::base::ssh'
contain '::nest::profile::base::users' contain '::nest::base::users'
# Git should be installed before managing any Vcsrepos # Git should be installed before managing any Vcsrepos
Class['::nest::profile::base::git'] -> Vcsrepo <| provider == git |> Class['::nest::base::git'] -> Vcsrepo <| provider == git |>
case $facts['osfamily'] { case $facts['osfamily'] {
'Gentoo': { 'Gentoo': {
contain '::nest::profile::base::bootloader' contain '::nest::base::bootloader'
contain '::nest::profile::base::distcc' contain '::nest::base::distcc'
contain '::nest::profile::base::distccd' contain '::nest::base::distccd'
contain '::nest::profile::base::dracut' contain '::nest::base::dracut'
contain '::nest::profile::base::firewall' contain '::nest::base::firewall'
contain '::nest::profile::base::fs' contain '::nest::base::fs'
contain '::nest::profile::base::fstab' contain '::nest::base::fstab'
contain '::nest::profile::base::kernel' contain '::nest::base::kernel'
contain '::nest::profile::base::mta' contain '::nest::base::mta'
contain '::nest::profile::base::network' contain '::nest::base::network'
contain '::nest::profile::base::openvpn' contain '::nest::base::openvpn'
contain '::nest::profile::base::portage' contain '::nest::base::portage'
contain '::nest::profile::base::sudo' contain '::nest::base::sudo'
contain '::nest::profile::base::systemd' contain '::nest::base::systemd'
contain '::nest::profile::base::zfs' contain '::nest::base::zfs'
unless $nest and $nest['profile'] == 'beaglebone' { unless $nest and $nest['profile'] == 'beaglebone' {
contain '::nest::profile::base::lvm' contain '::nest::base::lvm'
contain '::nest::profile::base::plymouth' contain '::nest::base::plymouth'
# Rebuild initramfs after plymouth changes # Rebuild initramfs after plymouth changes
Class['::nest::profile::base::plymouth'] Class['::nest::base::plymouth']
~> Class['::nest::profile::base::dracut'] ~> Class['::nest::base::dracut']
} }
# Setup distcc before portage, but distccd needs systemd, which is # Setup distcc before portage, but distccd needs systemd, which is
# installed after portage is configured. # installed after portage is configured.
Class['::nest::profile::base::distcc'] Class['::nest::base::distcc']
-> Class['::nest::profile::base::portage'] -> Class['::nest::base::portage']
-> Class['::nest::profile::base::distccd'] -> Class['::nest::base::distccd']
# Portage should be configured before any packages are installed/changed # Portage should be configured before any packages are installed/changed
Class['::nest::profile::base::portage'] -> Package <| title != 'sys-devel/distcc' and Class['::nest::base::portage'] -> Package <| title != 'sys-devel/distcc' and
title != 'dev-vcs/git' and title != 'dev-vcs/git' and
title != 'app-admin/eselect' |> title != 'app-admin/eselect' |>
Class['::nest::profile::base::portage'] -> Nest::Lib::Portage::Package_use <| |> Class['::nest::base::portage'] -> Nest::Lib::Portage::Package_use <| |>
# Portage configuration (profile) responsible for installing systemd # Portage configuration (profile) responsible for installing systemd
Class['::nest::profile::base::portage'] Class['::nest::base::portage']
-> Class['::nest::profile::base::systemd'] -> Class['::nest::base::systemd']
# Dracut depends on systemd/console setup # Dracut depends on systemd/console setup
Class['::nest::profile::base::systemd'] Class['::nest::base::systemd']
~> Class['::nest::profile::base::dracut'] ~> Class['::nest::base::dracut']
# Rebuild initramfs and reconfigure bootloader after kernel changes # Rebuild initramfs and reconfigure bootloader after kernel changes
Class['::nest::profile::base::kernel'] Class['::nest::base::kernel']
~> Class['::nest::profile::base::dracut'] ~> Class['::nest::base::dracut']
~> Class['::nest::profile::base::bootloader'] ~> Class['::nest::base::bootloader']
# Rebuild initramfs after ZFS changes # Rebuild initramfs after ZFS changes
Class['::nest::profile::base::kernel'] Class['::nest::base::kernel']
-> Class['::nest::profile::base::zfs'] -> Class['::nest::base::zfs']
~> Class['::nest::profile::base::dracut'] ~> Class['::nest::base::dracut']
# Sudo requires configured MTA # Sudo requires configured MTA
Class['::nest::profile::base::mta'] Class['::nest::base::mta']
-> Class['::nest::profile::base::sudo'] -> Class['::nest::base::sudo']
# Dracut liveimg depends on dhcp, pulled in by network class # Dracut liveimg depends on dhcp, pulled in by network class
Class['::nest::profile::base::network'] Class['::nest::base::network']
-> Class['::nest::profile::base::dracut'] -> Class['::nest::base::dracut']
# OpenVPN modifies resolvconf which is installed for NetworkManager # OpenVPN modifies resolvconf which is installed for NetworkManager
Class['::nest::profile::base::network'] Class['::nest::base::network']
-> Class['::nest::profile::base::openvpn'] -> Class['::nest::base::openvpn']
if $::nest::libvirt { if $::nest::libvirt {
contain '::nest::profile::base::libvirt' contain '::nest::base::libvirt'
# libvirt ebuild checks kernel config # libvirt ebuild checks kernel config
Class['::nest::profile::base::kernel'] Class['::nest::base::kernel']
-> Class['::nest::profile::base::libvirt'] -> Class['::nest::base::libvirt']
} }
} }
'windows': { 'windows': {
contain '::nest::profile::base::cygwin' contain '::nest::base::cygwin'
Class['::nest::profile::base::cygwin'] -> Package <| provider == 'cygwin' and title != 'cygrunsrv' |> Class['::nest::base::cygwin'] -> Package <| provider == 'cygwin' and title != 'cygrunsrv' |>
# The users class manages my cygwin home directory # The users class manages my cygwin home directory
Class['::nest::profile::base::cygwin'] -> Class['::nest::profile::base::users'] Class['::nest::base::cygwin'] -> Class['::nest::base::users']
} }
} }
} }
class nest::profile::base::bootloader { class nest::base::bootloader {
$kernel_cmdline = [ $kernel_cmdline = [
'init=/lib/systemd/systemd', 'init=/lib/systemd/systemd',
'quiet', 'quiet',
...@@ -16,18 +16,18 @@ class nest::profile::base::bootloader { ...@@ -16,18 +16,18 @@ class nest::profile::base::bootloader {
case $::nest::bootloader { case $::nest::bootloader {
systemd: { systemd: {
contain 'nest::profile::base::bootloader::systemd' contain 'nest::base::bootloader::systemd'
} }
default: { default: {
contain 'nest::profile::base::bootloader::grub' contain 'nest::base::bootloader::grub'
exec { 'dracut': exec { 'dracut':
command => 'version=$(ls /lib/modules | sort -V | tail -1) && dracut --force --kver $version', command => 'version=$(ls /lib/modules | sort -V | tail -1) && dracut --force --kver $version',
refreshonly => true, refreshonly => true,
timeout => 0, timeout => 0,
provider => shell, provider => shell,
notify => Class['nest::profile::base::bootloader::grub'], notify => Class['nest::base::bootloader::grub'],
} }
} }
} }
......
class nest::profile::base::bootloader::grub { class nest::base::bootloader::grub {
$font = "ter-x${::nest::console_font_size}b" $font = "ter-x${::nest::console_font_size}b"
nest::lib::portage::package_use { 'sys-boot/grub': nest::lib::portage::package_use { 'sys-boot/grub':
...@@ -67,7 +67,7 @@ class nest::profile::base::bootloader::grub { ...@@ -67,7 +67,7 @@ class nest::profile::base::bootloader::grub {
} }
file_line { 'grub-set-kernel-cmdline': file_line { 'grub-set-kernel-cmdline':
line => "GRUB_CMDLINE_LINUX=\"${::nest::profile::base::bootloader::kernel_cmdline}\"", line => "GRUB_CMDLINE_LINUX=\"${::nest::base::bootloader::kernel_cmdline}\"",
match => '^#?GRUB_CMDLINE_LINUX=', match => '^#?GRUB_CMDLINE_LINUX=',
} }
......
class nest::profile::base::bootloader::systemd { class nest::base::bootloader::systemd {
if $facts['virtual'] == 'lxc' or $facts['os']['architecture'] == 'armv7l' { if $facts['virtual'] == 'lxc' or $facts['os']['architecture'] == 'armv7l' {
$bootctl_args = '--no-variables' $bootctl_args = '--no-variables'
} else { } else {
...@@ -28,7 +28,7 @@ class nest::profile::base::bootloader::systemd { ...@@ -28,7 +28,7 @@ class nest::profile::base::bootloader::systemd {
; ;
'/etc/kernel/cmdline': '/etc/kernel/cmdline':
content => "root=zfs:AUTO ${::nest::profile::base::bootloader::kernel_cmdline}\n", content => "root=zfs:AUTO ${::nest::base::bootloader::kernel_cmdline}\n",
notify => Exec['kernel-install'], notify => Exec['kernel-install'],
; ;
} }
......
class nest::profile::base::cygwin { class nest::base::cygwin {
package { 'cygwin': package { 'cygwin':
ensure => installed, ensure => installed,
} }
......
class nest::profile::base::distcc { class nest::base::distcc {
package { 'sys-devel/distcc': package { 'sys-devel/distcc':
ensure => installed, ensure => installed,
} }
......
class nest::profile::base::distccd { class nest::base::distccd {
if $::nest::distcc_server { if $::nest::distcc_server {
$disable_verbose_content = @(EOT) $disable_verbose_content = @(EOT)
[Service] [Service]
......
class nest::profile::base::dracut { class nest::base::dracut {
package { 'sys-kernel/dracut': package { 'sys-kernel/dracut':
ensure => installed, ensure => installed,
} }
......
class nest::profile::base::firewall { class nest::base::firewall {
# Doing anything related to iptables inside an ARM chroot fails # Doing anything related to iptables inside an ARM chroot fails
if $facts['os']['architecture'] == 'armv7l' { if $facts['os']['architecture'] == 'armv7l' {
if $facts['virtual'] == 'lxc' { if $facts['virtual'] == 'lxc' {
......
class nest::profile::base::fs { class nest::base::fs {
package { 'net-fs/nfs-utils': package { 'net-fs/nfs-utils':
ensure => installed, ensure => installed,
} }
......
class nest::profile::base::fstab { class nest::base::fstab {
$hostname = regsubst($::trusted['certname'], '\..*', '') $hostname = regsubst($::trusted['certname'], '\..*', '')
# XXX: Improve this # XXX: Improve this
......
class nest::profile::base::git { class nest::base::git {
$package_name = $facts['osfamily'] ? { $package_name = $facts['osfamily'] ? {
'Gentoo' => 'dev-vcs/git', 'Gentoo' => 'dev-vcs/git',
default => git, default => git,
......
class nest::profile::base::kernel { class nest::base::kernel {
file { '/etc/portage/patches/sys-kernel': file { '/etc/portage/patches/sys-kernel':
ensure => absent, ensure => absent,
recurse => true, recurse => true,
...@@ -52,9 +52,9 @@ class nest::profile::base::kernel { ...@@ -52,9 +52,9 @@ class nest::profile::base::kernel {
$install_target = 'install' $install_target = 'install'
} }
include '::nest::profile::base::portage' include '::nest::base::portage'
exec { 'make kernel': exec { 'make kernel':
command => "/usr/bin/make ${::nest::profile::base::portage::makeopts} clean olddefconfig all ${install_target} modules_install", command => "/usr/bin/make ${::nest::base::portage::makeopts} clean olddefconfig all ${install_target} modules_install",
cwd => '/usr/src/linux', cwd => '/usr/src/linux',
path => ['/usr/lib/distcc/bin', '/usr/bin', '/bin'], path => ['/usr/lib/distcc/bin', '/usr/bin', '/bin'],
environment => 'HOME=/root', # for distcc environment => 'HOME=/root', # for distcc
...@@ -63,7 +63,7 @@ class nest::profile::base::kernel { ...@@ -63,7 +63,7 @@ class nest::profile::base::kernel {
} }
exec { 'module-rebuild': exec { 'module-rebuild':
command => "/usr/bin/emerge --usepkg n --jobs ${::nest::profile::base::portage::loadlimit} --load-average ${::nest::profile::base::portage::loadlimit} @module-rebuild", command => "/usr/bin/emerge --usepkg n --jobs ${::nest::base::portage::loadlimit} --load-average ${::nest::base::portage::loadlimit} @module-rebuild",
timeout => 0, timeout => 0,
refreshonly => true, refreshonly => true,
subscribe => Exec['make kernel'], subscribe => Exec['make kernel'],
......
class nest::profile::base::libvirt { class nest::base::libvirt {
nest::lib::portage::package_use { 'app-emulation/libvirt': nest::lib::portage::package_use { 'app-emulation/libvirt':
use => ['virt-network', 'zfs'], use => ['virt-network', 'zfs'],
} }
......
class nest::profile::base::lvm { class nest::base::lvm {
package { 'sys-fs/lvm2': package { 'sys-fs/lvm2':
ensure => installed, ensure => installed,
} }
......
class nest::profile::base::mta { class nest::base::mta {
package { 'mail-mta/nullmailer': package { 'mail-mta/nullmailer':
ensure => installed, ensure => installed,
} }
......
class nest::profile::base::network { class nest::base::network {
# resolvconf now provided by systemd # resolvconf now provided by systemd
nest::lib::portage::package_use { 'net-misc/networkmanager': nest::lib::portage::package_use { 'net-misc/networkmanager':
ensure => absent, ensure => absent,
......
class nest::profile::base::openvpn { class nest::base::openvpn {
$device = 'tun0' $device = 'tun0'
$hosts_file = '/etc/hosts.nest' $hosts_file = '/etc/hosts.nest'
......
class nest::profile::base::packages { class nest::base::packages {
case $facts['osfamily'] { case $facts['osfamily'] {
'Gentoo': { 'Gentoo': {
package { [ package { [
......
class nest::profile::base::plymouth { class nest::base::plymouth {
file { [ file { [
'/etc/portage/patches/sys-boot', '/etc/portage/patches/sys-boot',
'/etc/portage/patches/sys-boot/plymouth', '/etc/portage/patches/sys-boot/plymouth',
......
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