From b024d1db3705ce44ca33c207db6e6196799c7fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Mon, 28 Nov 2016 19:02:08 +0100 Subject: [PATCH] Rename default_shell_path arg and add doc. --- README.md | 11 +++++++++++ manifests/config.pp | 2 +- manifests/init.pp | 14 +++++++------- manifests/params.pp | 12 ++++++------ 4 files changed, 25 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 234d03f..9f71fed 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,16 @@ class { 'root': } ``` +### Other default shell + +Bash is the default shell use on Debian, if you prefer an advanced shell or didn't have Bash, you can define the DEFAULT_SHELL_PATH argument : + +``` +class { 'root': + default_shell_path => '/bin/zsh', +} +``` + Then, every connection from 10.10.10.1 or 192.168.0.42 will automatically have ZSH as default shell. ## Reference @@ -53,6 +63,7 @@ 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'. * `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'. +* `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'. ## Limitations diff --git a/manifests/config.pp b/manifests/config.pp index 0cccf58..1d5f955 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -21,7 +21,7 @@ class root::config { # Shell user { 'root': - shell => "${root::default_shell}", + shell => "${root::default_shell_path}", } diff --git a/manifests/init.pp b/manifests/init.pp index 4e5ce07..3adaee9 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -36,13 +36,13 @@ # Copyright 2016 Your name here, unless otherwise noted. # class root ( - $profile_path = $root::params::profile_path, - $profile_content = $root::params::profile_content, - $bashrc_path = $root::params::bashrc_path, - $bashrc_content = $root::params::bashrc_content, - $bashrc_content = $root::params::bashrc_content, - $default_shell = $root::params::default_shell, - $ip_zsh = $root::params::ip_zsh, + $profile_path = $root::params::profile_path, + $profile_content = $root::params::profile_content, + $bashrc_path = $root::params::bashrc_path, + $bashrc_content = $root::params::bashrc_content, + $bashrc_content = $root::params::bashrc_content, + $default_shell_path = $root::params::default_shell_path, + $ip_zsh = $root::params::ip_zsh, ) inherits root::params { include '::root::config' diff --git a/manifests/params.pp b/manifests/params.pp index 44953ad..f59f4ab 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -3,15 +3,15 @@ class root::params { # Preferences files - $profile_path = '/root/.profile' - $profile_content = 'root/preferences/profile.erb' + $profile_path = '/root/.profile' + $profile_content = 'root/preferences/profile.erb' - $bashrc_path = '/root/.bashrc' - $bashrc_content = 'root/preferences/bashrc.erb' + $bashrc_path = '/root/.bashrc' + $bashrc_content = 'root/preferences/bashrc.erb' # Shell - $default_shell = '/bin/bash' + $default_shell_path = '/bin/bash' # For those IP, auto-launch ZSH as default shell - $ip_zsh = '127.0.0.1' + $ip_zsh = '127.0.0.1' } # Private class: root::params