Skip to content

Commit

Permalink
Verify RGW VIP is properly configured in keystone
Browse files Browse the repository at this point in the history
We had an issue related to the rgw_vip configuration. This patch removes
the cidr usage from the facts and passes it to the rgw ingress template.
In addition, ipaddr filter is used to properly get the ipaddress and
fail if malformed (or is just not what we expect).
  • Loading branch information
fultonj authored and fmount committed Oct 1, 2024
1 parent 9dc2925 commit 2ebaca7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion playbooks/ceph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@
tasks_from: rgw
vars:
# cifmw_cephadm_vip is computed or passed as an override via -e @extra.yml
cifmw_cephadm_rgw_vip: "{{ cifmw_cephadm_vip }}/{{ cidr }}"
cifmw_cephadm_rgw_vip: "{{ cifmw_cephadm_vip }}"

- name: Configure Monitoring Stack
when: cifmw_ceph_daemons_layout.dashboard_enabled | default(false) | bool
Expand Down
4 changes: 2 additions & 2 deletions roles/cifmw_cephadm/tasks/configure_object.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@
script: |-
oc -n {{ cifmw_cephadm_ns }} rsh openstackclient openstack role add --user {{ all_uuids.results.0.stdout }} --project {{ project_service_uuid.stdout }} {{ all_uuids.results.2.stdout }}
oc -n {{ cifmw_cephadm_ns }} rsh openstackclient openstack role add --user {{ all_uuids.results.0.stdout }} --project {{ project_service_uuid.stdout }} {{ all_uuids.results.3.stdout }}
oc -n {{ cifmw_cephadm_ns }} rsh openstackclient openstack endpoint create --region regionOne {{ all_uuids.results.1.stdout }} public {{ cifmw_cephadm_urischeme }}://{{ cifmw_external_dns_vip_ext.values() | first if cifmw_external_dns_vip_ext is defined else cifmw_cephadm_vip }}:8080/swift/v1/AUTH_%\(tenant_id\)s
oc -n {{ cifmw_cephadm_ns }} rsh openstackclient openstack endpoint create --region regionOne {{ all_uuids.results.1.stdout }} internal {{ cifmw_cephadm_urischeme }}://{{ cifmw_external_dns_vip_int.values() | first if cifmw_external_dns_vip_int is defined else cifmw_cephadm_vip }}:8080/swift/v1/AUTH_%\(tenant_id\)s
oc -n {{ cifmw_cephadm_ns }} rsh openstackclient openstack endpoint create --region regionOne {{ all_uuids.results.1.stdout }} public {{ cifmw_cephadm_urischeme }}://{{ cifmw_external_dns_vip_ext.values() | first if cifmw_external_dns_vip_ext is defined else cifmw_cephadm_rgw_vip | ansible.utils.ipaddr('address') }}:8080/swift/v1/AUTH_%\(tenant_id\)s
oc -n {{ cifmw_cephadm_ns }} rsh openstackclient openstack endpoint create --region regionOne {{ all_uuids.results.1.stdout }} internal {{ cifmw_cephadm_urischeme }}://{{ cifmw_external_dns_vip_int.values() | first if cifmw_external_dns_vip_int is defined else cifmw_cephadm_rgw_vip | ansible.utils.ipaddr('address') }}:8080/swift/v1/AUTH_%\(tenant_id\)s
oc -n {{ cifmw_cephadm_ns }} rsh openstackclient openstack role add --project {{ all_uuids.results.4.stdout }} --user {{ all_uuids.results.5.stdout }} {{ all_uuids.results.6.stdout }}
delegate_to: localhost
when:
Expand Down
8 changes: 7 additions & 1 deletion roles/cifmw_cephadm/tasks/post.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,14 @@
loop: "{{ cifmw_cephadm_log_commands }}"

- name: Configure ceph object store to use external ceph object gateway
when:
- cifmw_cephadm_vip is defined
- cifmw_cephadm_vip | default("") | length > 0
- cifmw_ceph_daemons_layout.rgw_enabled | default(true) | bool
ansible.builtin.include_tasks: configure_object.yml
when: cifmw_ceph_daemons_layout.rgw_enabled | default(true) | bool
vars:
cifmw_cephadm_rgw_vip: "{{ cifmw_cephadm_vip }}"


- name: Dashboard service validation
ansible.builtin.include_tasks: dashboard/validation.yml
Expand Down
4 changes: 2 additions & 2 deletions roles/cifmw_cephadm/tasks/rgw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
- name: Define cifmw_external_dns_vip_ext
ansible.builtin.set_fact:
cifmw_external_dns_vip_ext: "{{ cifmw_external_dns_vip_ext | default({}) |
combine({ (cifmw_cephadm_vip): 'rgw-external.ceph.local' }) }}"
combine({ (cifmw_cephadm_rgw_vip | ansible.utils.ipaddr('address')): 'rgw-external.ceph.local' }) }}"

- name: Define cifmw_external_dns_vip_int
ansible.builtin.set_fact:
cifmw_external_dns_vip_int: "{{ cifmw_external_dns_vip_ext | default({}) |
combine({ (cifmw_cephadm_vip): 'rgw-internal.ceph.local' }) }}"
combine({ (cifmw_cephadm_rgw_vip | ansible.utils.ipaddr('address')): 'rgw-internal.ceph.local' }) }}"

- name: Create DNS domain and certificate
ansible.builtin.include_role:
Expand Down
2 changes: 1 addition & 1 deletion roles/cifmw_cephadm/templates/ceph_rgw.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
monitor_port: 8999
virtual_interface_networks:
- {{ cifmw_cephadm_rgw_network }}
virtual_ip: {{ cifmw_cephadm_vip }}
virtual_ip: {{ cifmw_cephadm_rgw_vip }}/{{ cidr }}
{% if rgw_frontend_cert is defined %}
ssl_cert: |
{{ rgw_frontend_cert | indent( width=6 ) }}
Expand Down

0 comments on commit 2ebaca7

Please sign in to comment.