Add the possibility to forward root's mail.
This commit is contained in:
parent
b024d1db37
commit
70693afe26
14
README.md
14
README.md
|
@ -22,6 +22,7 @@ This "root" module simply define few preferences for the root user.
|
||||||
### What root affects
|
### What root affects
|
||||||
|
|
||||||
* Root's configuration files (/root/.profile, /root/.bashrc,…).
|
* Root's configuration files (/root/.profile, /root/.bashrc,…).
|
||||||
|
* Root's mail can be forward to other addresses.
|
||||||
|
|
||||||
### Beginning with root
|
### Beginning with root
|
||||||
|
|
||||||
|
@ -51,6 +52,16 @@ class { 'root':
|
||||||
|
|
||||||
Then, every connection from 10.10.10.1 or 192.168.0.42 will automatically have ZSH as default shell.
|
Then, every connection from 10.10.10.1 or 192.168.0.42 will automatically have ZSH as default shell.
|
||||||
|
|
||||||
|
### Forward mail
|
||||||
|
|
||||||
|
Root's mail can be forward to other addresses. You can specify thoses addresses with the ADDRESS_TO_FORWARD argument :
|
||||||
|
|
||||||
|
```
|
||||||
|
class { 'root':
|
||||||
|
address_to_forward => 'username@domain.org,firstname.lastname@other-domain.org',
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Reference
|
## Reference
|
||||||
|
|
||||||
### Classes
|
### Classes
|
||||||
|
@ -63,6 +74,9 @@ Then, every connection from 10.10.10.1 or 192.168.0.42 will automatically have Z
|
||||||
* `profile_content` : Template file used to generate the previous configuration file. Defaults to 'root/preferences/profile.erb'.
|
* `profile_content` : Template file used to generate the previous configuration file. Defaults to 'root/preferences/profile.erb'.
|
||||||
* `bashrc_path` : Path to the Bash's rcfile. Defaults to '/root/.bashrc'.
|
* `bashrc_path` : Path to the Bash's rcfile. Defaults to '/root/.bashrc'.
|
||||||
* `bashrc_content` : Template file used to generate the previous configuration file. Default to 'root/preferences/bashrc.erb'.
|
* `bashrc_content` : Template file used to generate the previous configuration file. Default to 'root/preferences/bashrc.erb'.
|
||||||
|
* `forward_path` : Path to the forward file. Defaults to '/root/.forward'.
|
||||||
|
* `forward_content` : Template file used to generate the previous configuration file. Default to 'root/preferences/forward.erb'.
|
||||||
|
* `address_to_forward` : List of addresses that must receive root's mails. Default to ''.
|
||||||
* `default_shell_path` : Path to a bin file to use as default shell for root. Defaults to '/bin/bash'.
|
* `default_shell_path` : Path to a bin file to use as default shell for root. Defaults to '/bin/bash'.
|
||||||
* `ip_zsh` : A regex to determine if a ssh client should have ZSH as default shell. Defaults to '127.0.0.1'.
|
* `ip_zsh` : A regex to determine if a ssh client should have ZSH as default shell. Defaults to '127.0.0.1'.
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,12 @@ class root::config {
|
||||||
content => template($root::bashrc_content),
|
content => template($root::bashrc_content),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Mail
|
||||||
|
file { $root::forward_path:
|
||||||
|
ensure => present,
|
||||||
|
content => template($root::forward_content),
|
||||||
|
}
|
||||||
|
|
||||||
# Shell
|
# Shell
|
||||||
user { 'root':
|
user { 'root':
|
||||||
shell => "${root::default_shell_path}",
|
shell => "${root::default_shell_path}",
|
||||||
|
|
|
@ -41,6 +41,9 @@ class root (
|
||||||
$bashrc_path = $root::params::bashrc_path,
|
$bashrc_path = $root::params::bashrc_path,
|
||||||
$bashrc_content = $root::params::bashrc_content,
|
$bashrc_content = $root::params::bashrc_content,
|
||||||
$bashrc_content = $root::params::bashrc_content,
|
$bashrc_content = $root::params::bashrc_content,
|
||||||
|
$forward_path = $root::params::forward_path,
|
||||||
|
$forward_content = $root::params::forward_content,
|
||||||
|
$address_to_forward = $root::params::address_to_forward,
|
||||||
$default_shell_path = $root::params::default_shell_path,
|
$default_shell_path = $root::params::default_shell_path,
|
||||||
$ip_zsh = $root::params::ip_zsh,
|
$ip_zsh = $root::params::ip_zsh,
|
||||||
) inherits root::params {
|
) inherits root::params {
|
||||||
|
|
|
@ -9,6 +9,11 @@ class root::params {
|
||||||
$bashrc_path = '/root/.bashrc'
|
$bashrc_path = '/root/.bashrc'
|
||||||
$bashrc_content = 'root/preferences/bashrc.erb'
|
$bashrc_content = 'root/preferences/bashrc.erb'
|
||||||
|
|
||||||
|
# Mail
|
||||||
|
$forward_path = '/root/.forward'
|
||||||
|
$forward_content = 'root/preferences/forward.erb'
|
||||||
|
$address_to_forward = ''
|
||||||
|
|
||||||
# Shell
|
# Shell
|
||||||
$default_shell_path = '/bin/bash'
|
$default_shell_path = '/bin/bash'
|
||||||
# For those IP, auto-launch ZSH as default shell
|
# For those IP, auto-launch ZSH as default shell
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
<%= scope.lookupvar('root::address_to_forward') %>
|
Reference in New Issue