diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-03-13 13:23:17 +0100 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2018-03-13 22:51:36 +0100 |
commit | 0a21fb6c2c52ca5cc2dfdfc41ca0a51c0d81296c (patch) | |
tree | 95af1b06a4b8d67759628071f163b3d42c9c7f22 /modules/base_installation/manifests | |
parent | 96d61e22a20255c2b437eb3a3b81f9b44a1814de (diff) | |
download | Puppet-0a21fb6c2c52ca5cc2dfdfc41ca0a51c0d81296c.tar.gz Puppet-0a21fb6c2c52ca5cc2dfdfc41ca0a51c0d81296c.tar.zst Puppet-0a21fb6c2c52ca5cc2dfdfc41ca0a51c0d81296c.zip |
Start to cleanup the files
Diffstat (limited to 'modules/base_installation/manifests')
-rw-r--r-- | modules/base_installation/manifests/puppet.pp | 2 | ||||
-rw-r--r-- | modules/base_installation/manifests/services.pp | 2 | ||||
-rw-r--r-- | modules/base_installation/manifests/users.pp | 20 |
3 files changed, 14 insertions, 10 deletions
diff --git a/modules/base_installation/manifests/puppet.pp b/modules/base_installation/manifests/puppet.pp index b3ce492..6f7732d 100644 --- a/modules/base_installation/manifests/puppet.pp +++ b/modules/base_installation/manifests/puppet.pp | |||
@@ -67,7 +67,7 @@ class base_installation::puppet ( | |||
67 | require => File[$base_installation::puppet_conf_path], | 67 | require => File[$base_installation::puppet_conf_path], |
68 | } | 68 | } |
69 | 69 | ||
70 | $ips = lookup("ips") |$key| { {} } | 70 | $ips = lookup("ips", { 'default_value' => undef }) |
71 | file { "$base_installation::puppet_conf_path/host_ldap.info": | 71 | file { "$base_installation::puppet_conf_path/host_ldap.info": |
72 | content => template("base_installation/puppet/host_ldap.info.erb"), | 72 | content => template("base_installation/puppet/host_ldap.info.erb"), |
73 | require => File[$base_installation::puppet_conf_path], | 73 | require => File[$base_installation::puppet_conf_path], |
diff --git a/modules/base_installation/manifests/services.pp b/modules/base_installation/manifests/services.pp index c641f4b..d7b4d61 100644 --- a/modules/base_installation/manifests/services.pp +++ b/modules/base_installation/manifests/services.pp | |||
@@ -38,7 +38,7 @@ class base_installation::services inherits base_installation { | |||
38 | group => "root" | 38 | group => "root" |
39 | } | 39 | } |
40 | 40 | ||
41 | $ip6 = lookup("ips.v6") |$key| { {} } | 41 | $ip6 = lookup("ips.v6", { 'default_value' => undef }) |
42 | file { '/etc/systemd/network/en-dhcp.network': | 42 | file { '/etc/systemd/network/en-dhcp.network': |
43 | ensure => "present", | 43 | ensure => "present", |
44 | path => "/etc/systemd/network/en-dhcp.network", | 44 | path => "/etc/systemd/network/en-dhcp.network", |
diff --git a/modules/base_installation/manifests/users.pp b/modules/base_installation/manifests/users.pp index 766c0f0..f893c51 100644 --- a/modules/base_installation/manifests/users.pp +++ b/modules/base_installation/manifests/users.pp | |||
@@ -26,22 +26,26 @@ class base_installation::users ( | |||
26 | ensure => "present", | 26 | ensure => "present", |
27 | groups => $user[groups], | 27 | groups => $user[groups], |
28 | managehome => true, | 28 | managehome => true, |
29 | system => !!$user[system], | ||
29 | home => "/home/${user[username]}", | 30 | home => "/home/${user[username]}", |
30 | notify => Exec["remove_password"], | 31 | notify => Exec["remove_password:${user[username]}:${user[userid]}"], |
31 | purge_ssh_keys => true | 32 | purge_ssh_keys => true |
32 | } | 33 | } |
33 | 34 | ||
34 | exec { "remove_password": | 35 | exec { "remove_password:${user[username]}:${user[userid]}": |
35 | command => "/usr/bin/chage -d 0 ${user[username]} && /usr/bin/passwd -d ${user[username]}", | 36 | command => "/usr/bin/chage -d 0 ${user[username]} && /usr/bin/passwd -d ${user[username]}", |
37 | onlyif => "/usr/bin/test -z '${user[password]}'", | ||
36 | refreshonly => true | 38 | refreshonly => true |
37 | } | 39 | } |
38 | 40 | ||
39 | $user[keys].each |$key| { | 41 | if has_key($user, "keys") { |
40 | ssh_authorized_key { "${user[username]}@${key[host]}": | 42 | $user[keys].each |$key| { |
41 | name => "${user[username]}@${key[host]}", | 43 | ssh_authorized_key { "${user[username]}@${key[host]}": |
42 | user => $user[username], | 44 | name => "${user[username]}@${key[host]}", |
43 | type => $key[key_type], | 45 | user => $user[username], |
44 | key => $key[key], | 46 | type => $key[key_type], |
47 | key => $key[key], | ||
48 | } | ||
45 | } | 49 | } |
46 | } | 50 | } |
47 | } | 51 | } |