From 7f9786da29b414d94af99c77be7fe16a6e919fba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 24 Jan 2022 11:11:45 +0100 Subject: Broke profiles into parts. --- manifests/repo.pp | 12 ++++++++++++ manifests/sudo.pp | 17 +++++++++++++++++ manifests/workstation.pp | 15 +++------------ manifests/workstation/family/archlinux.pp | 6 ------ 4 files changed, 32 insertions(+), 18 deletions(-) create mode 100644 manifests/repo.pp create mode 100644 manifests/sudo.pp diff --git a/manifests/repo.pp b/manifests/repo.pp new file mode 100644 index 0000000..afe88d2 --- /dev/null +++ b/manifests/repo.pp @@ -0,0 +1,12 @@ +# Configure private custom repo for those dists that support it +class profiles::repo { + case $facts['osfamily'] { + 'Archlinux': { + pacman::repo { 'adrift-space': + ensure => present, + server => 'http://repo.gandalf.adrift.space/arch', + sig_level => 'Optional', + } + } + } +} diff --git a/manifests/sudo.pp b/manifests/sudo.pp new file mode 100644 index 0000000..6b5fe6b --- /dev/null +++ b/manifests/sudo.pp @@ -0,0 +1,17 @@ +class profiles::sudo { + file { '/etc/sudoers': + validate_cmd => '/usr/bin/visudo -cf %', + content => @(EOF) + Defaults insults + root ALL=(ALL) ALL + %root ALL=(ALL) ALL + %wheel ALL=(ALL) ALL + + @includedir /etc/sudoers.d + | EOF + } + + file { '/etc/sudoers.d': + ensure => directory, + } +} diff --git a/manifests/workstation.pp b/manifests/workstation.pp index 051f3fc..d70fa57 100644 --- a/manifests/workstation.pp +++ b/manifests/workstation.pp @@ -12,6 +12,8 @@ class profiles::workstation ( include ::profiles::group_profile + include ::profiles::repo + if ($facts['systemd']) { file { 'User ssh-agent service': path => '/etc/systemd/user/ssh-agent.service', @@ -119,17 +121,6 @@ class profiles::workstation ( source => 'puppet:///modules/profiles/passmenu', } - file { '/etc/sudoers': - validate_cmd => '/usr/bin/visudo -cf %', - content => @(EOF) - Defaults insults - root ALL=(ALL) ALL - %root ALL=(ALL) ALL - %wheel ALL=(ALL) ALL - - @includedir /etc/sudoers.d - | EOF - } - + include ::profiles::sudo include ::profiles::mounts } diff --git a/manifests/workstation/family/archlinux.pp b/manifests/workstation/family/archlinux.pp index f84946c..306b903 100644 --- a/manifests/workstation/family/archlinux.pp +++ b/manifests/workstation/family/archlinux.pp @@ -24,12 +24,6 @@ class profiles::workstation::family::archlinux { line => "MAKEFLAGS='-j${cpus}'" } - pacman::repo { 'adrift-space': - ensure => present, - server => 'http://repo.gandalf.adrift.space/arch', - sig_level => 'Optional', - } - # remove # - netctl -- cgit v1.2.3