feat: add ceph rgw (#380)

- start managing ceph configuration file
- manage ceph-radosgw
- merge the ceph::conf and ceph::node profiles
- ensure the ceph repos exist
- mange nginx frontend and consul service

Reviewed-on: #380
This commit was merged in pull request #380.
This commit is contained in:
2025-08-13 12:33:41 +10:00
parent f4af5e7b64
commit 92728047e7
6 changed files with 175 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
class profiles::ceph::conf (
Hash $config = {}
) {
package {[
'ceph',
'ceph-common'
]:
ensure => installed,
}
file {'/etc/ceph':
ensure => directory,
owner => 'ceph',
group => 'ceph',
mode => '0755',
require => Package['ceph'],
}
file {'/var/log/ceph':
ensure => directory,
owner => 'ceph',
group => 'ceph',
mode => '0755',
require => Package['ceph'],
}
file { '/etc/ceph/ceph.conf':
ensure => file,
owner => 'ceph',
group => 'ceph',
mode => '0644',
content => template('profiles/ceph/conf.erb'),
require => Package['ceph-common'],
}
}
+41
View File
@@ -0,0 +1,41 @@
class profiles::ceph::rgw (
Boolean $enable = true,
Hash[String, String] $ceph_client_keys = {},
Stdlib::Absolutepath $base_path = '/var/lib/ceph'
){
$key = $ceph_client_keys[$facts['networking']['hostname']]
if $enable {
include profiles::ceph::conf
package {'ceph-radosgw':
ensure => installed,
}
file { [
"${base_path}/radosgw",
"${base_path}/radosgw/ceph-${facts['networking']['hostname']}"
]:
ensure => directory,
owner => 'ceph',
group => 'ceph',
mode => '0750',
}
file { "${base_path}/radosgw/ceph-${facts['networking']['hostname']}/keyring":
ensure => file,
owner => 'ceph',
group => 'ceph',
mode => '0750',
content => Sensitive("[client.${facts['networking']['hostname']}]\n key = ${key}\n")
}
service {"ceph-radosgw@${facts['networking']['hostname']}":
ensure => true,
enable => true,
subscribe => File["${base_path}/radosgw/ceph-${facts['networking']['hostname']}/keyring"]
}
}
}
+9
View File
@@ -0,0 +1,9 @@
# Managed by Puppet in profiles::ceph::conf
<% @config.each do |section, settings| -%>
[<%= section %>]
<% settings.each do |key, value| -%>
<%# Convert booleans and numbers to strings, leave strings untouched %>
<%= key %> = <%= value.is_a?(TrueClass) ? 'true' : value.is_a?(FalseClass) ? 'false' : value %>
<% end -%>
<% end -%>