From c1d99759ae0bae69c671734ebd569ac627af891b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Mon, 28 Nov 2016 18:52:17 +0100 Subject: [PATCH] Add a variable to set root's default shell. --- manifests/config.pp | 8 +++++++- manifests/init.pp | 1 + manifests/params.pp | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/manifests/config.pp b/manifests/config.pp index 5821b1d..0cccf58 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -8,7 +8,7 @@ class root::config { mode => 600, } - # Set .profile and bashrc files + # Preferences files file { $root::profile_path: ensure => present, content => template($root::profile_content), @@ -19,4 +19,10 @@ class root::config { content => template($root::bashrc_content), } + # Shell + user { 'root': + shell => "${root::default_shell}", + } + + } # Private class: root::config diff --git a/manifests/init.pp b/manifests/init.pp index bd5dbfb..4e5ce07 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -41,6 +41,7 @@ class root ( $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, ) inherits root::params { diff --git a/manifests/params.pp b/manifests/params.pp index 972a68b..44953ad 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -2,12 +2,15 @@ # class root::params { + # Preferences files $profile_path = '/root/.profile' $profile_content = 'root/preferences/profile.erb' $bashrc_path = '/root/.bashrc' $bashrc_content = 'root/preferences/bashrc.erb' + # Shell + $default_shell = '/bin/bash' # For those IP, auto-launch ZSH as default shell $ip_zsh = '127.0.0.1'