-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
95fe965
commit 16dc00b
Showing
9 changed files
with
265 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
class shadow::logindefs ( | ||
$maildir = $shadow::params::maildir_default, | ||
$pass_max_days = $shadow::params::pass_max_days_default, | ||
$pass_min_days = $shadow::params::pass_min_days_default, | ||
$pass_min_len = $shadow::params::pass_min_len_default, | ||
$pass_warn_age = $shadow::params::pass_warn_age_default, | ||
$uid_min = '1000', | ||
$uid_max = '60000', | ||
$gid_min = '1000', | ||
$gid_max = '60000', | ||
$sys_uid_min = $shadow::params::sys_uid_min_default, | ||
$sys_uid_max = $shadow::params::sys_uid_max_default, | ||
$sys_gid_min = $shadow::params::sys_gid_min_default, | ||
$sys_gid_max = $shadow::params::sys_gid_max_default, | ||
) inherits shadow { | ||
|
||
class { '::shadow::install': } -> | ||
class { '::shadow::logindefs::config': } -> | ||
Class['::shadow::logindefs'] | ||
|
||
case $::osfamily | ||
{ | ||
'redhat': | ||
{ | ||
case $::operatingsystemrelease | ||
{ | ||
/^[6-7].*$/: | ||
{ | ||
$package_name='shadow-utils' | ||
$maildir_default = '/var/spool/mail' | ||
} | ||
default: { fail("Unsupported RHEL/CentOS version! - ${::operatingsystemrelease}") } | ||
} | ||
} | ||
'Debian': | ||
{ | ||
case $::operatingsystem | ||
{ | ||
'Ubuntu': | ||
{ | ||
case $::operatingsystemrelease | ||
{ | ||
/^1[4-7].*$/: | ||
{ | ||
fail('not implemented') | ||
} | ||
default: { fail("Unsupported Ubuntu version! - ${::operatingsystemrelease}") } | ||
} | ||
} | ||
'Debian': { fail('Unsupported') } | ||
default: { fail('Unsupported Debian flavour!') } | ||
} | ||
} | ||
'Suse': | ||
{ | ||
case $::operatingsystem | ||
{ | ||
'SLES': | ||
{ | ||
case $::operatingsystemrelease | ||
{ | ||
'11.3': | ||
{ | ||
fail('not implemented') | ||
} | ||
default: { fail("Unsupported operating system ${::operatingsystem} ${::operatingsystemrelease}") } | ||
} | ||
} | ||
default: { fail("Unsupported operating system ${::operatingsystem}") } | ||
} | ||
} | ||
default: { fail('Unsupported OS!') } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class shadow::logindefs::config inherits useradd { | ||
|
||
file { '/etc/login.defs': | ||
ensure => 'present', | ||
group => 'root', | ||
owner => 'root', | ||
mode => '0644', | ||
content => template("${module_name}/logindefs/logindefs.erb"), | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
class shadow::useradd ( | ||
$group = '100', | ||
$home = '/home', | ||
$inactive = '-1', | ||
$expire = undef, | ||
$shell = '/sbin/nologin', | ||
$skel = '/etc/skel', | ||
) inherits shadow { | ||
|
||
class { '::shadow::install': } -> | ||
class { '::shadow::useradd::config': } -> | ||
Class['::shadow::useradd'] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class shadow::useradd::config inherits useradd { | ||
|
||
file { '/etc/default/useradd': | ||
ensure => 'present', | ||
group => 'root', | ||
owner => 'root', | ||
mode => '0600', | ||
content => template("${module_name}/useradd/useradd.erb"), | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# | ||
# puppet managed file | ||
# | ||
# /etc/login.defs - Configuration control definitions for the login package. | ||
# | ||
|
||
|
||
MAIL_DIR <%= @maildir %> | ||
|
||
|
||
# Password aging controls: | ||
|
||
# PASS_MAX_DAYS Maximum number of days a password may be used. | ||
PASS_MAX_DAYS <%= @pass_max_days %> | ||
|
||
# PASS_MIN_DAYS Minimum number of days allowed between password changes. | ||
PASS_MIN_DAYS <%= @pass_min_days %> | ||
|
||
# PASS_MIN_LEN Minimum acceptable password length. | ||
PASS_MIN_LEN <%= @pass_min_len %> | ||
|
||
# PASS_WARN_AGE Number of days warning given before a password expires. | ||
PASS_WARN_AGE <%= @pass_warn_age %> | ||
|
||
# | ||
# Min/max values for automatic uid/gid selection in useradd | ||
# | ||
UID_MIN <%= @uid_min %> | ||
UID_MAX <%= @uid_max %> | ||
GID_MIN <%= @gid_min %> | ||
GID_MAX <%= @gid_max %> | ||
<% if defined?(@sys_uid_min) -%> | ||
SYS_UID_MIN <%= @sys_uid_min %> | ||
<% end -%> | ||
<% if defined?(@sys_uid_max) -%> | ||
SYS_UID_MAX <%= @sys_uid_max %> | ||
<% end -%> | ||
<% if defined?(@sys_gid_min) -%> | ||
SYS_GID_MIN <%= @sys_gid_min %> | ||
<% end -%> | ||
<% if defined?(@sys_gid_max) -%> | ||
SYS_GID_MAX <%= @sys_gid_max %> | ||
<% end -%> | ||
|
||
# | ||
# If defined, this command is run when removing a user. | ||
# It should remove any at/cron/print jobs etc. owned by | ||
# the user to be removed (passed as the first argument). | ||
# | ||
#USERDEL_CMD /usr/sbin/userdel_local | ||
|
||
# | ||
# If useradd should create home directories for users by default | ||
# On RH systems, we do. This option is overridden with the -m flag on | ||
# useradd command line. | ||
# | ||
CREATE_HOME yes | ||
|
||
# The permission mask is initialized to this value. If not specified, | ||
# the permission mask will be initialized to 022. | ||
UMASK 077 | ||
|
||
# This enables userdel to remove user groups if no members exist. | ||
# | ||
USERGROUPS_ENAB yes | ||
|
||
# Use SHA512 to encrypt password. | ||
ENCRYPT_METHOD SHA512 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# puppet managed file | ||
# | ||
# useradd defaults file | ||
# | ||
GROUP=<%= @group %> | ||
HOME=<%= @home %> | ||
INACTIVE=<%= @inactive %> | ||
EXPIRE=<%= @expire %> | ||
SHELL=<%= @shell %> | ||
SKEL=<%= @skel %> |