summaryrefslogtreecommitdiffstats
path: root/manifests/params.pp
blob: 4fe4e8f0a5262756e3aadc67334217163683a046 (plain)
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
# GlusterFS module by James
# Copyright (C) 2010-2013+ James Shubin
# Written by James Shubin <james@shubin.ca>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

class gluster::params(
	# packages...
	$package_glusterfs = 'glusterfs',
	$package_glusterfs_fuse = 'glusterfs-fuse',
	$package_glusterfs_server = 'glusterfs-server',
	$package_glusterfs_api = 'glusterfs-api',

	$package_e2fsprogs = 'e2fsprogs',
	$package_xfsprogs = 'xfsprogs',

	$package_python_argparse = 'python-argparse',
	$package_python_lxml = 'python-lxml',
	$package_fping = 'fping',

	# programs...
	$program_gluster = '/usr/sbin/gluster',

	$program_modprobe = '/sbin/modprobe',
	$program_lsmod = '/sbin/lsmod',

	$program_parted = '/sbin/parted',
	$program_pvcreate = '/sbin/pvcreate',
	$program_vgcreate = '/sbin/vgcreate',
	$program_lvcreate = '/sbin/lvcreate',
	$program_vgs = '/sbin/vgs',
	$program_lvs = '/sbin/lvs',
	$program_pvdisplay = '/sbin/pvdisplay',
	$program_vgdisplay = '/sbin/vgdisplay',
	#$program_lvdisplay = '/sbin/lvdisplay',
	$program_xfsadmin = '/usr/sbin/xfs_admin',
	$program_mkfs_xfs = '/sbin/mkfs.xfs',
	$program_mkfs_ext4 = '/sbin/mkfs.ext4',

	$program_fping = '/usr/sbin/fping',
	$program_findmnt = '/bin/findmnt',

	# services...
	$service_glusterd = 'glusterd',

	# misc...
	$misc_gluster_reload = '/sbin/service glusterd reload',

	# comment...
	$comment = ''
) {
	if "${comment}" == '' {
		warning('Unable to load yaml data/ directory!')
	}

	include puppet::facter
	$factbase = "${::puppet::facter::base}"
	$hash = {
		'gluster_program_gluster' => $program_gluster,
	}
	# create a custom external fact!
	file { "${factbase}gluster_program.yaml":
		content => inline_template('<%= @hash.to_yaml %>')
		owner => root,
		group => root,
		mode => 644,		# u=rw,go=r
		ensure => present,
	}
}

# vim: ts=8