puppet-prod/site/profiles/manifests/ceph/client.pp
Ben Vincent 5631f07e6e feat: add cephfs shared volume define
- add ceph class to manage ceph client configuration/packages
- add cephfs define for mounting volumes
- add ceph keyring define to manage secrets used to mount cephfs
2024-06-23 15:33:33 +10:00

44 lines
1.0 KiB
Puppet

# profiles::ceph::client
class profiles::ceph::client (
String $fsid,
Array[Stdlib::Host] $mons,
Stdlib::Absolutepath $config_file = '/etc/ceph/ceph.conf',
String $owner = 'ceph',
String $group = 'ceph',
Stdlib::Filemode $mode = '0644',
Hash $keyrings = {},
) {
# dont run this on proxmox nodes
if $facts['enc_role'] != 'roles::infra::proxmox::node' {
# install the ceph client package
package { 'ceph-common':
ensure => installed,
}
# manage the ceph directory
file { '/etc/ceph':
ensure => directory,
owner => $owner,
group => $group,
mode => $mode,
require => Package['ceph-common'],
}
# create a basic client config
file { $config_file:
ensure => file,
owner => $owner,
group => $group,
mode => $mode,
content => template('profiles/ceph/client.conf.erb'),
require => Package['ceph-common'],
}
# manage ceph keyrings
create_resources('profiles::ceph::keyring', $keyrings)
}
}