[submodule "modules/reboot"]
path = modules/reboot
url = https://github.com/puppetlabs/puppetlabs-reboot.git
+[submodule "modules/systemd"]
+ path = modules/systemd
+ url = https://github.com/jkroepke/puppet-systemd.git
+[submodule "modules/inifile"]
+ path = modules/inifile
+ url = https://github.com/puppetlabs/puppetlabs-inifile.git
+[submodule "modules/sudo"]
+ path = modules/sudo
+ url = https://github.com/saz/puppet-sudo.git
+[submodule "modules/ssh"]
+ path = modules/ssh
+ url = https://github.com/saz/puppet-ssh.git
+[submodule "modules/puppetlabs_concat"]
+ path = modules/concat
+ url = https://github.com/puppetlabs/puppetlabs-concat.git
class { 'base_packages': }
class { 'locales': }
class { 'cron_puppet': }
+ class { 'base_configuration':
+ hostname => 'new.immae.eu'
+ }
reboot { 'after_run':
apply => 'finished'
--- /dev/null
+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',
+ }
+ }
+}
class base_packages {
# Preinstalled
- package { 'base':
- ensure => 'latest',
- }
- package { 'openssh':
- ensure => 'latest',
- }
- package { 'grub':
- ensure => 'latest',
- }
- package { 'sudo':
- ensure => 'latest',
- }
+ ensure_packages(['base', 'openssh', 'grub', 'sudo'])
# Puppet dependencies
- package { 'git':
- ensure => 'latest',
- }
- package { 'puppet':
- ensure => 'latest',
- }
+ ensure_packages(['git', 'puppet'])
}
--- /dev/null
+Subproject commit bdf92329db427b7e202cf762091985ea6b64b3c8
--- /dev/null
+Subproject commit 3099468f61d0f0c7465c61279376a7e68cef0352
--- /dev/null
+Subproject commit d0c77c06b7d9e03c9c30f564605e07535ee8f5c9
--- /dev/null
+Subproject commit 6dad85360bf119368a2fe396da2e22c81e01f4dd
--- /dev/null
+Subproject commit b0a93b8c4fa18f1f2c477c5348e9bccd3bdebd6b