Commit
the ceph.conf.j2 always assumes the hostname used to register the radosgw in the servicemap is equivalent to `{{ ansible_hostname }}` which returns the shortname form. We need to detect which form of the hostname was used in case of already deployed cluster and update the ceph.conf accordingly. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1580408 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -217,3 +217,28 @@ | |
when: | ||
- containerized_deployment | ||
- ceph_docker_image | search("rhceph") | ||
|
||
- block: | ||
- name: get current cluster status (if already running) | ||
command: "{{ docker_exec_cmd }} ceph --cluster {{ cluster }} -s -f json" | ||
register: ceph_current_status | ||
|
||
- name: set_fact ceph_current_status (convert to json) | ||
set_fact: | ||
ceph_current_status: "{{ ceph_current_status.stdout | from_json }}" | ||
|
||
- name: set_fact rgw_hostname | ||
set_fact: | ||
rgw_hostname: "{% for key in ceph_current_status['servicemap']['services']['rgw']['daemons'].keys() %}{% if key == ansible_fqdn %}{{ key }}{% endif %}{% endfor %}" | ||
when: | ||
- ceph_current_fsid.get('rc', 1) == 0 | ||
- inventory_hostname in groups.get(rgw_group_name, []) | ||
# no servicemap before luminous | ||
- ceph_release_num[ceph_release] >= ceph_release_num['luminous'] | ||
- ansible_hostname != ansible_fqdn | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
leseb
Member
|
||
|
||
- name: set_fact rgw_hostname | ||
set_fact: | ||
rgw_hostname: "{{ ansible_hostname }}" | ||
when: | ||
- rgw_hostname is undefined |
3 comments
on commit f422efb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leseb sure here is an example log
fatal: [aio1_ceph-rgw_container-fc588f0a]: FAILED! => {"changed": false, "cmd": "ceph --cluster ceph -s -f json", "msg": "[Errno 2] No such file or directory"
The problem is that ansible_hostname
returns aio1_ceph-rgw_container-fc588f0a
but ansible_fqdn
returns aio1_ceph-rgw_container-fc588f0a.openstack.local
so the conditional is evaluated to True
and the task is executed. However, at this point, the ceph-common
which is responsible to install the required ceph
packages hasn't been executed and so the ceph
binary does not exist.
In our playbooks we first execute the ceph-default
role and then ceph-common
.
https://github.com/openstack/openstack-ansible/blob/master/playbooks/ceph-rgw-install.yml#L45-L48
However, as stated before, the ceph-default
role apparently requires packages which are only installed by the ceph-common
role.
Would you suggest to re-arrange the roles so we execute ceph-common
before ceph-default
to workaround this problem?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hwoarang Thanks for the clarification! lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait, there is still something strange, typically this line f422efb#diff-2857b72f37476e1b5d16e7e81783ecbaR234 should prevent the block from being executed.
@guits I think the
ansible_hostname != ansible_fqdn
is not correct.ansible_hostname
normally does not contain the domain name so this conditional may end up to evaluate totrue
for no reason. Maybe 'ansible_hostname != inventory_hostname` is the correct one?This caused a regression in OpenStack ansible when deploying Ceph