class profiles::arch_builder ( Hash $conf, Array $package_list, String $package_list_file = '/usr/local/aur/aur-packages.yaml', ) { include ::profiles::repo include ::profiles::sudo exec { '/usr/bin/pacman -Syu --noconfirm': } ensure_packages([ 'base', 'base-devel', 'python', 'python-yaml', # Note that auracle git is NOT in the standard repos, and needs to # be manually bootstraped to work 'auracle-git', ]) $aur_builder = 'aur-builder' $aur_home = '/usr/local/aur' user { $aur_builder: system => true, home => $aur_home, shell => '/usr/bin/nologin', } file { '/etc/sudoers.d/aur_builder': content => "${aur_builder} ALL=(ALL) NOPASSWD: /usr/bin/pacman\n", validate_cmd => '/usr/bin/visudo -cf %', } $conf_override = { 'package-list' => $package_list_file, } $yaml_settings = { 'header' => '# This file is controlled by Puppet', } file { '/etc/xdg/aur-runner': ensure => directory, } -> file { '/etc/xdg/aur-runner/config.yaml': content => hash2yaml($conf + $conf_override, $yaml_settings), } file { $package_list_file: ensure => file, force => true, content => hash2yaml({ 'packages' => $package_list }, $yaml_settings), } class { 'pacman::makepkg': makeflags => '-j4', packager => 'Hugo Hörnquist (automatically) <>', } }