docker: fix monitors name

Prior to this change we were deploying a monitor using tis fqdn name but
we were checking its state and performing actions on it using its
shortname.

Signed-off-by: Sébastien Han <seb@redhat.com>
pull/1377/head
Sébastien Han 2017-03-28 14:15:27 +02:00
parent 2aa5286544
commit 12b2aa2e55
5 changed files with 8 additions and 4 deletions

View File

@ -10,6 +10,8 @@ dummy:
#ceph_docker_registry: docker.io
#ceph_docker_enable_centos_extra_repo: false
#mon_use_fqdn: false # if set to true, the MON name used will be the fqdn
# Set uid/gid to default '64045' for bootstrap directories.
# '64045' is used for debian based distros. It must be set to 167 in case of rhel based distros.
# These values have to be set according to the base OS used by the container image, NOT the host.

View File

@ -86,7 +86,7 @@ dummy:
#ceph_mon_docker_subnet: "{{ public_network }}"# subnet of the ceph_mon_docker_interface
#ceph_docker_image: "ceph/daemon"
#ceph_docker_image_tag: latest
#ceph_mon_docker_extra_env: -e CLUSTER={{ cluster }} -e FSID={{ fsid }} -e MON_NAME={{ ansible_hostname }}
#ceph_mon_docker_extra_env: -e CLUSTER={{ cluster }} -e FSID={{ fsid }} -e MON_NAME={{ monitor_name }}
#ceph_docker_on_openstack: false
#mon_docker_privileged: false
#mon_docker_net_host: true

View File

@ -2,6 +2,8 @@
ceph_docker_registry: docker.io
ceph_docker_enable_centos_extra_repo: false
mon_use_fqdn: false # if set to true, the MON name used will be the fqdn
# Set uid/gid to default '64045' for bootstrap directories.
# '64045' is used for debian based distros. It must be set to 167 in case of rhel based distros.
# These values have to be set according to the base OS used by the container image, NOT the host.

View File

@ -78,7 +78,7 @@ ceph_mon_docker_interface: "{{ monitor_interface }}"
ceph_mon_docker_subnet: "{{ public_network }}"# subnet of the ceph_mon_docker_interface
ceph_docker_image: "ceph/daemon"
ceph_docker_image_tag: latest
ceph_mon_docker_extra_env: -e CLUSTER={{ cluster }} -e FSID={{ fsid }} -e MON_NAME={{ ansible_hostname }}
ceph_mon_docker_extra_env: -e CLUSTER={{ cluster }} -e FSID={{ fsid }} -e MON_NAME={{ monitor_name }}
ceph_docker_on_openstack: false
mon_docker_privileged: false
mon_docker_net_host: true

View File

@ -51,14 +51,14 @@
- include: start_docker_monitor.yml
- name: wait for monitor socket to exist
command: docker exec ceph-mon-{{ ansible_hostname }} stat /var/run/ceph/{{ cluster }}-mon.{{ ansible_fqdn }}.asok
command: docker exec ceph-mon-{{ ansible_hostname }} stat /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok
register: monitor_socket
retries: 5
delay: 15
until: monitor_socket.rc == 0
- name: force peer addition as potential bootstrap peer for cluster bringup
command: docker exec ceph-mon-{{ ansible_hostname }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ ansible_fqdn }}.asok add_bootstrap_peer_hint {{ hostvars[item]['ansible_' + ceph_mon_docker_interface].ipv4.address }}
command: docker exec ceph-mon-{{ ansible_hostname }} ceph --admin-daemon /var/run/ceph/{{ cluster }}-mon.{{ monitor_name }}.asok add_bootstrap_peer_hint {{ hostvars[item]['ansible_' + ceph_mon_docker_interface].ipv4.address }}
with_items: "{{ groups[mon_group_name] }}"
changed_when: false
failed_when: false