-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathparams.pp
111 lines (99 loc) · 3.33 KB
/
params.pp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File:: <tt>params.pp</tt>
# Author:: S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team ([email protected])
# Copyright:: Copyright (c) 2015 S. Varrette, H. Cartiaux, V. Plugaru, S. Diehl aka. UL HPC Management Team
# License:: Apache-2.0
#
# ------------------------------------------------------------------------------
# = Class: bash::params
#
# In this class are defined as variables values that are used in other
# bash classes.
# This class should be included, where necessary, and eventually be enhanced
# with support for more OS
#
# == Warnings
#
# /!\ Always respect the style guide available
# here[http://docs.puppetlabs.com/guides/style_guide]
#
# The usage of a dedicated param classe is advised to better deal with
# parametrized classes, see
# http://docs.puppetlabs.com/guides/parameterized_classes.html
#
# [Remember: No empty lines between comments and class definition]
#
class bash::params {
######## DEFAULTS FOR VARIABLES USERS CAN SET ##########################
# (Here are set the defaults, provide your custom variables externally)
# (The default used is in the line with '')
###########################################
# ensure the presence (or absence) of bash configuration
$ensure = 'present'
# Hash of bash aliases under the form key => 'command'
$aliases = undef
$dotfiles_provider = 'git'
$dotfiles_src = 'https://github.com/ULHPC/dotfiles.git'
$dotfiles_revision = 'master'
#### MODULE INTERNAL VARIABLES #########
# (Modify to adapt to unsupported OSes)
#######################################
# bash packages
$packagename = $facts['os']['name'] ? {
default => 'bash',
}
$extra_packages = $facts['os']['name'] ? {
#/(?i-mx:ubuntu|debian)/ => [],
#/(?i-mx:centos|fedora|redhat)/ => [],
default => [ 'bash-completion' ]
}
### Configuration directory & file
$ref_dotfilesdir = $facts['os']['name'] ? {
default => '/etc/dotfiles.d'
}
$dotfilesdir = $facts['os']['name'] ? {
default => '.dotfiles.d'
}
$local_confdir_before = '.bash.before.d'
$local_confdir = '.bash.d'
# Profile directory
# $bash_completion_giturl = "https://github.com/GArik/bash-completion.git"
# $bash_completion_src_url = "http://bash-completion.alioth.debian.org/files/bash-completion-2.0.tar.gz"
# $bash_completion_src_version = "2.0"
# Configuration directory & file
$configdir = $facts['os']['name'] ? {
default => '/etc/bashrc.d',
}
$profile_dir = $facts['os']['name'] ? {
default => '/etc/profile.d',
}
$completion_dir = $facts['os']['name'] ? {
default => '/etc/bash_completion.d'
}
$skel_dir = $facts['os']['name'] ? {
default => '/etc/skel'
}
$configdir_mode = $facts['os']['name'] ? {
default => '0755',
}
$configdir_owner = $facts['os']['name'] ? {
default => 'root',
}
$configdir_group = $facts['os']['name'] ? {
default => 'root',
}
$configfile = $facts['os']['family'] ? {
'Redhat' => '/etc/bashrc',
default => '/etc/bash.bashrc'
}
# Aliases files -- eventually user defined
$aliases_file = "${profile_dir}/bash_aliases.sh"
$configfile_mode = $facts['os']['name'] ? {
default => '0644',
}
$configfile_owner = $facts['os']['name'] ? {
default => 'root',
}
$configfile_group = $facts['os']['name'] ? {
default => 'root',
}
}