From 466dc44f7f240aaf6a23b76059e6c2f9577f066b Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Tue, 22 Aug 2023 10:40:13 +0200 Subject: [PATCH] Add support for specifying RGW networks We also handle `networks` being set to a string instead of a list, rather than skipping templating of this block. --- roles/cephadm/README.md | 6 ++++-- roles/cephadm/templates/cluster.yml.j2 | 9 +++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/roles/cephadm/README.md b/roles/cephadm/README.md index 78d4798..3271b8f 100644 --- a/roles/cephadm/README.md +++ b/roles/cephadm/README.md @@ -73,13 +73,15 @@ All Ceph hosts must be in the `ceph` group. ``` * RGWs * `cephadm_radosgw_services`: List of Rados Gateways services to deploy. `id` is an arbitrary name for the service, - `count_per_host` is desired number of RGW services per host. `spec` is optional additional service specification. - Previously undocumented `port` variable is no longer supported. + `count_per_host` is desired number of RGW services per host. `networks` is optional list of networks to bind to. + `spec` is optional additional service specification. Previously undocumented `port` variable is no longer supported. Example: ``` cephadm_radosgw_services: - id: myrgw count_per_host: 2 + networks: + - 10.66.0.0/24 spec: rgw_realm: myrealm rgw_zone: myzone diff --git a/roles/cephadm/templates/cluster.yml.j2 b/roles/cephadm/templates/cluster.yml.j2 index eb1691a..78e8363 100644 --- a/roles/cephadm/templates/cluster.yml.j2 +++ b/roles/cephadm/templates/cluster.yml.j2 @@ -49,6 +49,15 @@ placement: {% if service.count_per_host is defined %} count_per_host: {{ service.count_per_host }} {% endif %} +{% if service.networks is defined %} +{% if service.networks is string %} +networks: + - "{{ service.networks }}" +{% else %} +networks: + {{ service.networks | to_nice_yaml }} +{% endif %} +{% endif %} {% if service.spec is defined %} spec: {{ service.spec | to_nice_yaml }}