X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=inline;f=modules%2Fbase_configuration%2Fmanifests%2Finit.pp;h=8b2ce4ccb6ebba10eaa7526b802ddacab87bca49;hb=ba2cf1b5d938810077b0fd73844faf432e8e8f9d;hp=2b20a0e89908e0aabc688d5690a8eaa1ea271dfb;hpb=91a2b30dd703c827deebfb69f1b5561773beac00;p=perso%2FImmae%2FProjets%2FPuppet.git diff --git a/modules/base_configuration/manifests/init.pp b/modules/base_configuration/manifests/init.pp index 2b20a0e..8b2ce4c 100644 --- a/modules/base_configuration/manifests/init.pp +++ b/modules/base_configuration/manifests/init.pp @@ -1,14 +1,59 @@ class base_configuration ( - $hostname = undef, - $username = "immae", - $userid = 1000 + $hostname = undef, + $username = "immae", + $userid = 1000, + $code_path = undef, + $device = undef, ) { + unless empty($device) { + class { 'grub_install': + device => $device, + } + } + + class { 'locales': } + + unless empty($code_path) { + class { 'cron_puppet': + code_path => $code_path, + } + } + + service { "sshd": + #ensure => "running", + enable => true, + } + service { "systemd-networkd": + #ensure => "running", + enable => true, + } + service { "systemd-resolved": + #ensure => "running", + enable => true, + } + + file { "/etc/localtime": + ensure => "link", + target => "../usr/share/zoneinfo/Europe/Paris" + } + + exec { "set_locale": + command => "/usr/bin/systemd-firstboot --locale=fr_FR.UTF-8", + creates => "/etc/locale.conf", + } + unless empty($hostname) { - class { 'systemd::hostname': - hostname => $hostname + exec { "set_hostname": + command => "/usr/bin/systemd-firstboot --hostname=$hostname", + creates => "/etc/hostname", } } + file { "/etc/vconsole.conf": + ensure => "link", + target => "/dev/null", + } + user { "${username}:${userid}": name => $username, uid => $userid, @@ -31,7 +76,9 @@ class base_configuration ( } class { 'sudo': - config_file_replace => false + config_file_replace => false, + # Missing in the sudo package, should no be mandatory + package_ldap => false } sudo::conf { 'wheel': @@ -50,8 +97,59 @@ class base_configuration ( } } + ensure_packages('ruby-shadow') + user { 'root': + password => '!' + } + + file { '/etc/modprobe.d/pcspkr_no_autoload.conf': + ensure => "present", + path => "/etc/modprobe.d/pcspkr_no_autoload.conf", + source => 'puppet:///modules/base_configuration/pcspkr_no_autoload.conf', + mode => "0644", + owner => "root", + group => "root" + } + + file { '/etc/systemd/system/getty@tty1.service.d/': + ensure => "directory", + path => "/etc/systemd/system/getty@tty1.service.d/", + mode => "0755", + owner => "root", + group => "root" + } + + file { '/etc/systemd/system/getty@tty1.service.d/noclear.conf': + ensure => "present", + path => "/etc/systemd/system/getty@tty1.service.d/noclear.conf", + source => 'puppet:///modules/base_configuration/getty_conf_override.conf', + recurse => true, + mode => "0644", + owner => "root", + group => "root" + } + + file { '/etc/systemd/network/en-dhcp.network': + ensure => "present", + path => "/etc/systemd/network/en-dhcp.network", + source => 'puppet:///modules/base_configuration/en-dhcp.network', + mode => "0644", + owner => "root", + group => "root" + } + + file { '/etc/pacman.d/mirrorlist': + ensure => "present", + path => "/etc/pacman.d/mirrorlist", + source => 'puppet:///modules/base_configuration/mirrorlist', + mode => "0644", + owner => "root", + group => "root" + } + class { 'pacman': - color => true, + color => true, + usesyslog => true, } pacman::repo { 'multilib': @@ -78,7 +176,7 @@ class base_configuration ( create_mode => '0664', create_owner => 'root', create_group => 'utmp', - rotate => '1', + rotate => 1, minsize => '1M', } logrotate::rule { 'btmp': @@ -89,7 +187,7 @@ class base_configuration ( create_mode => '0600', create_owner => 'root', create_group => 'utmp', - rotate => '1', + rotate => 1, } ensure_packages(["whois"], { 'install_options' => '--asdeps' }) @@ -106,4 +204,6 @@ class base_configuration ( logpath => '', order => 10 } + + class { 'aur': } }