Skip to content

Instantly share code, notes, and snippets.

@mathslinux
Created February 23, 2014 15:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mathslinux/9173097 to your computer and use it in GitHub Desktop.
Save mathslinux/9173097 to your computer and use it in GitHub Desktop.
$fsid = '076a5970-b23b-4cad-91bb-fadccfb26a31'
$mon_secret = 'AQD7kyJQQGoOBhAAqrPAqSopSwPrrfMMomzVdw=='
Exec {
path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin'
}
#
class role_ceph (
$fsid,
$auth_type = 'cephx'
) {
class { 'ceph::conf':
fsid => $fsid,
auth_type => $auth_type,
cluster_network => "${::network_eth0}/24",
public_network => "${::network_eth0}/24"
}
include ceph::apt::ceph
}
#
class role_ceph_mon (
$id
) {
class { 'role_ceph':
fsid => $::fsid,
auth_type => 'cephx',
}
ceph::mon { $id:
monitor_secret => $::mon_secret,
mon_port => 6789,
mon_addr => $ipaddress_eth0,
}
}
node 'ceph1.test' {
if !empty($::ceph_admin_key) {
@@ceph::key { 'admin':
secret => $::ceph_admin_key,
keyring_path => '/etc/ceph/keyring',
}
}
class { 'role_ceph_mon': id => 0 }
# osd defination
class { 'ceph::osd' :
public_address => $ipaddress_eth0,
cluster_address => $ipaddress_eth0,
}
ceph::osd::device { '/dev/vdb': }
}
node 'ceph2.test' {
class { 'role_ceph_mon': id => 1 }
# osd defination
class { 'ceph::osd' :
public_address => $ipaddress_eth0,
cluster_address => $ipaddress_eth0,
}
ceph::osd::device { '/dev/vdb': }
}
node 'ceph3.test' {
class { 'role_ceph_mon': id => 2 }
# osd defination
class { 'ceph::osd' :
public_address => $ipaddress_eth0,
cluster_address => $ipaddress_eth0,
}
ceph::osd::device { '/dev/vdb': }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment