feat: add support for RGW in ci-multinode#2337
Conversation
There was a problem hiding this comment.
Code Review
This pull request configures Ceph RGW (Rados Gateway) for a CI multinode environment. It enables Ceph RGW in Kolla, defines RGW configuration commands in Cephadm, configures RGW hosts in Kolla globals, and sets up public network interfaces for storage nodes. Feedback has been provided to address a potential undefined variable error by using os_distribution instead of os_release for the CA bundle path, and to replace the fragile index-based groups.rgws lookup with direct hostname lookups for RGW hosts.
| ceph_rgw_hosts: | ||
| - host: storage-01 | ||
| ip: "{{ lookup('vars', storage_net_name ~ '_ips')[groups.rgws.0] }}" | ||
| port: 8100 | ||
| - host: storage-02 | ||
| ip: "{{ lookup('vars', storage_net_name ~ '_ips')[groups.rgws.1] }}" | ||
| port: 8100 | ||
| - host: storage-03 | ||
| ip: "{{ lookup('vars', storage_net_name ~ '_ips')[groups.rgws.2] }}" | ||
| port: 8100 |
There was a problem hiding this comment.
Using groups.rgws is problematic for two reasons:
- The standard Kolla Ansible group name for Ceph RGW is
rgw, notrgws, which would cause a template rendering failure. - Relying on the list index of the group (e.g.,
groups.rgws.0) is fragile because it assumes a specific ordering of hosts in the inventory and that there are at least 3 hosts in that group.
Since the hostnames (storage-01, storage-02, storage-03) are already hardcoded here, it is much safer and more robust to look up their IPs directly by hostname from the <network>_ips dictionary.
ceph_rgw_hosts:
- host: storage-01
ip: "{{ lookup('vars', storage_net_name ~ '_ips')['storage-01'] }}"
port: 8100
- host: storage-02
ip: "{{ lookup('vars', storage_net_name ~ '_ips')['storage-02'] }}"
port: 8100
- host: storage-03
ip: "{{ lookup('vars', storage_net_name ~ '_ips')['storage-03'] }}"
port: 8100| ca_bundle_path: >- | ||
| {{ | ||
| '/etc/ssl/certs/ca-certificates.crt' | ||
| if os_release == 'ubuntu' | ||
| else '/etc/pki/tls/certs/ca-bundle.crt' | ||
| }} |
There was a problem hiding this comment.
The variable os_release is not standard in this environment's configuration files. Other files (such as kolla.yml, storage.yml, and kolla/globals.yml) consistently use os_distribution to determine the OS flavor (e.g., 'ubuntu'). Using os_release here may result in an undefined variable error or incorrect evaluation.
ca_bundle_path: >-
{{
'/etc/ssl/certs/ca-certificates.crt'
if os_distribution == 'ubuntu'
else '/etc/pki/tls/certs/ca-bundle.crt'
}}Signed-off-by: Jack Hodgkiss <jack@stackhpc.com>
4dd69fa to
5c88c14
Compare
Add support for
RGWdeployment inci-multinodeenvironments.