Newer
Older
##CEPH Secrets
$secret_client_admin = 'AQDgL/hUSC2kLBAAnWJaSiqJG+YMk+XV9sapnw==',
$secret_client_bootstraposd = 'AQDlL/hUUCpdFBAAZeo6mKj4yeKPmVKfUY5awA==',
$secret_client_glance = 'AQBgGdJUCPwjLRAARZ0KEaxewYcYHT3j5Gl5Cg==',
$secret_client_cinder = 'AQAvxQpVKJ03KxAADFv78tedrAWZx1SoRdsQUA==',
$secret_client_cinderbackup = 'AQBKvuVUMHvaGhAADT6nvBv9LFs7dqpB8Kis0Q==',
$bootstrap_mds_key = 'AQBxkvVU4F+VDBAArxUf+8s0LbxIxNrbyEC1kw==',
$mon_key = 'AQApksZUIJhXJxAAEHVW/dbL1OeLA7Om++zdVw==',
##CEPH
$fsid = 'f65809d3-7961-4cd7-b731-a9bc94bc6e9c',
# Uncomment if auth_type is different from 'cephx'
#authentication_type = 'cephx',
$mon_initial_members = 'ocp-05,ocp-06,ocp-07',
$mon_host = '10.10.98.43,10.10.98.44,10.10.98.45',
$osd_pool_default_size = '3',
$osd_pool_default_min_size = '2',
$cluster_network = '10.10.98.0/24',
$public_network = '10.10.98.0/24',
$osd_journal_size = '2048',
##Old implementation (pseudo hash)
#$ceph_osd1 = ['/dev/vdb,/osd1','/dev/vdc,/osd2'],
#$ceph_pool1 = ['images,128', 'volumes,128', 'vms,128', 'backups,128'],
##New implementation (hash array)
#$ceph_pool2 = [{"pool" => "images", "pg_num" => "128"},
# {"pool" => "volumes", "pg_num" => "128"},
# {"pool" => "vms", "pg_num" => "128"},
# {"pool" => "backups", "pg_num" => "128"}],
#$ceph_osd2 = [{"partition" => "/dev/vdb", "journal" => "/osd1"},
# {"partition" => "/dev/vdc", "journal" => "/osd2"}],
##New implementation (hash)
#$ceph_pool3 = {'images' => { pg_num => '128'},
# 'volumes' => { pg_num => '128'},
# 'vms' => { pg_num => '128'},
# 'backups' => { pg_num => '128'}},
#$ceph_osd3 = {'/dev/vdb'=> { journal => '/osd1'},
# '/dev/vdc'=> { journal => '/osd2'}},
$ceph_pool = {'images' => { pg_num => '128'},
'volumes' => { pg_num => '128'},
'vms' => { pg_num => '128'},
'backups' => { pg_num => '128'}},
$ceph_osd = {'/dev/vdb'=> { journal => '/osd1'},
'/dev/vdc'=> { journal => '/osd2'}},
#foo::map {$ceph_osd1:}
#define foo::map () { notify {$name["title"]: } }
# Ceph
##OSD
create_resources( ceph::osd, $ceph_osd )
# iaas::resources::ceph::cephosd { $ceph_osd2: }
# ceph::osd {$ceph_osd2: }
Alessandro Costantini
committed
# ceph::osd {
# '/dev/vdb':
# journal => '/osd1';
Alessandro Costantini
committed
# '/dev/vdc':
# journal => '/osd2',
# }
##POOL
create_resources( ceph::pool, $ceph_pool )
# iaas::resources::ceph::cephpool { $ceph_pool2: }
# ceph::pool {
# 'images':
# pg_num => 128;
# 'volumes':
# pg_num => 128;
# 'vms':
# pg_num => 128;
# 'backups':
# pg_num => 128,
# }
##KEY
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
ceph::key {
'client.admin':
secret => $secret_client_admin,
cap_mon => 'allow *',
cap_osd => 'allow *',
cap_mds => 'allow',
inject => 'true',
inject_as_id => 'mon.',
inject_keyring => "/var/lib/ceph/mon/ceph-$::hostname/keyring";
'client.bootstrap-osd':
secret => $secret_client_bootstraposd,
cap_mon => 'allow profile bootstrap-osd',
keyring_path => '/var/lib/ceph/bootstrap-osd/ceph.keyring',
inject => 'true',
inject_as_id => 'mon.',
inject_keyring => "/var/lib/ceph/mon/ceph-$::hostname/keyring";
'client.glance':
secret => $secret_client_glance,
cap_mon => 'allow r',
cap_osd => 'allow class-read object_prefix rbd_children, allow rwx pool=images',
inject => 'true',
inject_as_id => 'mon.',
inject_keyring => "/var/lib/ceph/mon/ceph-$::hostname/keyring";
'client.cinder':
secret => $secret_client_cinder,
cap_mon => 'allow r',
cap_osd => 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms, allow rx pool=images',
inject => 'true',
inject_as_id => 'mon.',
inject_keyring => "/var/lib/ceph/mon/ceph-$::hostname/keyring";
'client.cinder-backup':
secret => $secret_client_cinderbackup,
cap_mon => 'allow r',
cap_osd => 'allow class-read object_prefix rbd_children, allow rwx pool=backups',
inject => 'true',
inject_as_id => 'mon.',
inject_keyring => "/var/lib/ceph/mon/ceph-$::hostname/keyring",
}
# Base
class { 'iaas::profile::base': } ->
# CEPH
class {'ceph::profile::params':
fsid => $fsid,
# Uncomment if auth_type is different from 'cephx'
#authentication_type => 'cephx',
mon_initial_members => $mon_initial_members,
mon_host => $mon_host,
osd_pool_default_pg_num => '100',
osd_pool_default_pgp_num => '100',
osd_pool_default_size => $osd_pool_default_size,
osd_pool_default_min_size => $osd_pool_default_min_size,
cluster_network => $cluster_network,
public_network => $public_network,
mon_key => $mon_key,
osd_journal_size => $osd_journal_size,
} ->
class { 'ceph::profile::base': } ->
class { 'ceph::profile::mon': } ->
class { 'ceph::keys': } ->