feat: manage proxmox nodes
- change /etc/hosts to meet proxmox requirements - add proxmox node role - add init, params, repo, install, clusterjoin classes
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
# profiles::proxmox::ceph
|
||||
class profiles::proxmox::ceph {
|
||||
|
||||
# include params class
|
||||
include profiles::proxmox::params
|
||||
|
||||
# localise some vars
|
||||
$network = $profiles::proxmox::params::pve_ceph_network
|
||||
$size = $profiles::proxmox::params::pve_ceph_size
|
||||
$min_size = $profiles::proxmox::params::pve_ceph_minsize
|
||||
|
||||
# install ceph if it is enabled
|
||||
if $profiles::proxmox::params::pve_ceph_install {
|
||||
|
||||
# initialise the cluster, but only on the clusterinit node and only if its not already initialised
|
||||
if $profiles::proxmox::params::pve_clusterinit_master and ! $facts['pve_ceph_initialised']{
|
||||
exec { 'pveceph_init':
|
||||
command => "/usr/bin/pveceph init --network ${network} --size ${size} --min_size ${min_size}",
|
||||
user => 'root',
|
||||
}
|
||||
}
|
||||
|
||||
if $facts['pve_ceph_initialised'] {
|
||||
|
||||
# create monitors
|
||||
if $profiles::proxmox::params::pve_ceph_mon {
|
||||
|
||||
# only when its not already a monitor
|
||||
if ! $facts['is_pveceph_mon'] {
|
||||
exec { 'pveceph_mon':
|
||||
command => '/usr/bin/pveceph mon create',
|
||||
user => 'root',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# create managers
|
||||
if $profiles::proxmox::params::pve_ceph_mgr {
|
||||
|
||||
# only when its not already a manager
|
||||
if ! $facts['is_pveceph_mgr'] {
|
||||
exec { 'pveceph_mgr':
|
||||
command => '/usr/bin/pveceph mgr create',
|
||||
user => 'root',
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user