X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fbase_configuration%2Fmanifests%2Finit.pp;fp=modules%2Fbase_configuration%2Fmanifests%2Finit.pp;h=4c6ca1e155cd5d210644aade25a239ea74322aaf;hb=f860f6d2b475fa611af2b6a66ee1c774757b77f4;hp=0000000000000000000000000000000000000000;hpb=fa935f639002f0333cadb34efaa4129842bca084;p=perso%2FImmae%2FProjets%2FPuppet.git diff --git a/modules/base_configuration/manifests/init.pp b/modules/base_configuration/manifests/init.pp new file mode 100644 index 0000000..4c6ca1e --- /dev/null +++ b/modules/base_configuration/manifests/init.pp @@ -0,0 +1,52 @@ +class base_configuration ( + $hostname = undef, + $username = "immae", + $userid = 1000 +) { + unless empty($hostname) { + class { 'systemd::hostname': + hostname => $hostname + } + } + + user { "${username}:${userid}": + name => $username, + uid => $userid, + ensure => "present", + groups => "wheel", + managehome => true, + notify => Exec["remove_password"] + } + + exec { "remove_password": + command => "/usr/bin/chage -d 0 $username && /usr/bin/passwd -d $username", + refreshonly => true + } + + ssh_authorized_key { $username: + name => "immae@immae.eu", + user => $username, + type => "ssh-rsa", + key => "AAAAB3NzaC1yc2EAAAADAQABAAABAQDi5PgLBwMRyRwzJPnSgUyRAuB9AAxMijsw1pR/t/wmxQne1O5fIPOleHx+D8dyZbwm+XkzlcJpgT0Qy3qC9J8BPhshJvO/tA/8CI/oS/FE0uWsyACH1DMO2dk4gRRZGSE9IuzDMRPlnfZ3n0tdsPzzv3GH4It/oPIgsvkTowKztGLQ7Xmjr5BxzAhXcIQymqA0U3XWHSdWvnSRDaOFG0PDoVMS85IdwlviVKLnV5Sstb4NC/P28LFfgvW8DO/XrOqujgDomqTmR41dK/AyrGGOb2cQUMO4l8Oa+74aOyKaB61rr/rJkr+wCbEttkTvgFa6zZygSk3edfiWE2rgn4+v" + } + + class { 'sudo': + config_file_replace => false + } + + sudo::conf { 'wheel': + priority => 10, + content => "%wheel ALL=(ALL) ALL" + } + + class { 'ssh::server': + storeconfigs_enabled => false, + options => { + 'AcceptEnv' => undef, + 'X11Forwarding' => 'yes', + 'PrintMotd' => 'no', + 'ChallengeResponseAuthentication' => 'no', + 'Subsystem' => 'sftp /usr/lib/openssh/sftp-server', + } + } +}