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 is contained in:
parent
f4af5e7b64
commit
92728047e7
@ -368,6 +368,28 @@ profiles::ceph::client::mons:
|
||||
- 10.18.15.1
|
||||
- 10.18.15.2
|
||||
- 10.18.15.3
|
||||
|
||||
profiles::ceph::conf::config:
|
||||
global:
|
||||
auth_client_required: 'cephx'
|
||||
auth_cluster_required: 'cephx'
|
||||
auth_service_required: 'cephx'
|
||||
fsid: 'de96a98f-3d23-465a-a899-86d3d67edab8'
|
||||
mon_allow_pool_delete: true
|
||||
mon_initial_members: 'prodnxsr0009,prodnxsr0010,prodnxsr0011,prodnxsr0012,prodnxsr0013'
|
||||
mon_host: '198.18.23.9,198.18.23.10,198.18.23.11,198.18.23.12,198.18.23.13'
|
||||
ms_bind_ipv4: true
|
||||
ms_bind_ipv6: false
|
||||
osd_crush_chooseleaf_type: 1
|
||||
osd_pool_default_min_size: 2
|
||||
osd_pool_default_size: 3
|
||||
osd_pool_default_pg_num: 128
|
||||
public_network: >
|
||||
198.18.23.1/32,198.18.23.2/32,198.18.23.3/32,198.18.23.4/32,
|
||||
198.18.23.5/32,198.18.23.6/32,198.18.23.7/32,198.18.23.8/32,
|
||||
198.18.23.9/32,198.18.23.10/32,198.18.23.11/32,198.18.23.12/32,
|
||||
198.18.23.13/32
|
||||
|
||||
#profiles::base::hosts::additional_hosts:
|
||||
# - ip: 198.18.17.9
|
||||
# hostname: prodinf01n09.main.unkin.net
|
||||
|
||||
8
hieradata/roles/infra/ceph/rgw.eyaml
Normal file
8
hieradata/roles/infra/ceph/rgw.eyaml
Normal file
@ -0,0 +1,8 @@
|
||||
---
|
||||
|
||||
profiles::ceph::rgw::ceph_client_keys:
|
||||
ausyd1nxvm2115: ENC[PKCS7,MIIBmQYJKoZIhvcNAQcDoIIBijCCAYYCAQAxggEhMIIBHQIBADAFMAACAQEwDQY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3xXLJRu2oDlgDCIOXeX6hxpu0qpj5c/9jMUSeV2DIydnxO+MiT3mceS50ip8B+zGQy5UedPmLt36Zs=]
|
||||
ausyd1nxvm2119: ENC[PKCS7,MIIBmQYJKoZIhvcNAQcDoIIBijCCAYYCAQAxggEhMIIBHQIBADAFMAACAQEwDQYJKoZIhvcNAQEBBQAEggEASlZglUxazp+9azfV3QkgRv+ACo+MH0RO5b18blbelgdmr38iwK7MwwEFpEfVJEyc/ph9RunWwrMmofDQHj5bBribfzZ2pH2CGiOrR0i5lZMtN0yQXPBA/+jm1Pi1AWGJLtoquuhMbibuHOTiXwBCBVrHHHaFTR5Xt34ABN/p/mCaG+N9nWux93msHCCextCalKBMmPhmI2q6HodfjanEVgYAe3/5hRPnpsi6IGSDNGygsTC3MG+hjGMpNF8izbwk9Lpzn6kY51aeNxI2ed9Jm8UZ/k+8b+o7ZQyWIBbf7DTFpEzk4G46puaDbXIorBWQ4azCjN3gt8VB91hwihtzcDBcBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBB6U+9z4cSzMTA1z9bmoX82gDBfy5zbRPK8GxImJo6evecMOTtaY2c4aEnESXtGBCS02enmxljv9dv1UYQD0/a6S3A=]
|
||||
59
hieradata/roles/infra/ceph/rgw.yaml
Normal file
59
hieradata/roles/infra/ceph/rgw.yaml
Normal file
@ -0,0 +1,59 @@
|
||||
---
|
||||
hiera_include:
|
||||
- profiles::ceph::rgw
|
||||
- profiles::nginx::simpleproxy
|
||||
|
||||
profiles::ceph::rgw::enable: true
|
||||
|
||||
# FIXME: puppet-python wants to try manage python-dev, which is required by the ceph package
|
||||
python::manage_dev_package: false
|
||||
|
||||
# additional altnames
|
||||
profiles::pki::vault::alt_names:
|
||||
- radosgw.main.unkin.net
|
||||
- radosgw.service.consul
|
||||
- radosgw.query.consul
|
||||
- "radosgw.service.%{facts.country}-%{facts.region}.consul"
|
||||
|
||||
# additional repos
|
||||
profiles::yum::global::repos:
|
||||
ceph:
|
||||
name: ceph
|
||||
descr: ceph repository
|
||||
target: /etc/yum.repos.d/ceph.repo
|
||||
baseurl: https://edgecache.query.consul/ceph/yum/el%{facts.os.release.major}/%{facts.os.architecture}
|
||||
gpgkey: https://download.ceph.com/keys/release.asc
|
||||
mirrorlist: absent
|
||||
ceph-noarch:
|
||||
name: ceph-noarch
|
||||
descr: ceph-noarch repository
|
||||
target: /etc/yum.repos.d/ceph-noarch.repo
|
||||
baseurl: https://edgecache.query.consul/ceph/yum/el%{facts.os.release.major}/noarch
|
||||
gpgkey: https://download.ceph.com/keys/release.asc
|
||||
mirrorlist: absent
|
||||
|
||||
# manage a simple nginx reverse proxy
|
||||
profiles::nginx::simpleproxy::nginx_vhost: 'radosgw.service.consul'
|
||||
profiles::nginx::simpleproxy::nginx_aliases:
|
||||
- radosgw.service.au-syd1.consul
|
||||
profiles::nginx::simpleproxy::proxy_port: 7480
|
||||
profiles::nginx::simpleproxy::proxy_path: '/'
|
||||
|
||||
# manage consul service
|
||||
consul::services:
|
||||
radosgw:
|
||||
service_name: 'radosgw'
|
||||
address: "%{facts.networking.ip}"
|
||||
port: 443
|
||||
checks:
|
||||
- id: 'radosgw_https_check'
|
||||
name: 'RADOSGW HTTPS Check'
|
||||
http: "https://%{facts.networking.fqdn}:443"
|
||||
method: 'GET'
|
||||
tls_skip_verify: true
|
||||
interval: '10s'
|
||||
timeout: '1s'
|
||||
profiles::consul::client::node_rules:
|
||||
- resource: service
|
||||
segment: radosgw
|
||||
disposition: write
|
||||
36
site/profiles/manifests/ceph/conf.pp
Normal file
36
site/profiles/manifests/ceph/conf.pp
Normal 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
site/profiles/manifests/ceph/rgw.pp
Normal file
41
site/profiles/manifests/ceph/rgw.pp
Normal 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
site/profiles/templates/ceph/conf.erb
Normal file
9
site/profiles/templates/ceph/conf.erb
Normal 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 -%>
|
||||
Loading…
Reference in New Issue
Block a user