# Sets up an arch system for running my arch-builder script, which # periodically fetches a list of packages, and builds them for # inclusion in an arch repo. 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 ensure_packages([ 'base', 'base-devel', 'python', 'python-yaml', 'python-pip', # Note that auracle git is NOT in the standard repos, and needs to # be manually bootstraped to work 'auracle-git', ]) ensure_packages([ 'coloredlogs', 'graypy', ], { provider => 'pip', }) $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), } # TODO fetch actuall aur-runner... # https://git.hornquist.se/aur-runner/ systemd::timer { 'aur-builder.timer': timer_source => 'puppet:///modules/profiles/arch_builder.timer', service_source => 'puppet:///modules/profiles/arch_builder.service', enable => true, } class { 'pacman::makepkg': makeflags => '-j4', packager => 'Hugo Hörnquist (automatically) <>', dlagents => { # Defaults, but with --silent added 'file' => '/usr/bin/curl --silent -gqC - -o %o %u', 'ftp' => '/usr/bin/curl --silent -gqfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u', 'http' => '/usr/bin/curl --silent -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u', 'https' => '/usr/bin/curl --silent -gqb "" -fLC - --retry 3 --retry-delay 3 -o %o %u', # Defaults, but needed since partial overrides aren't currently # supported 'rsync' => '/usr/bin/rsync --no-motd -z %u %o', 'scp' => '/usr/bin/scp -C %u %o', } } }