Skip to content
Snippets Groups Projects
Commit f4f06ea9 authored by Sébastien Han's avatar Sébastien Han
Browse files

ceph-mon/mds: fix fqdn


closes #596

Signed-off-by: default avatarSébastien Han <seb@redhat.com>
parent e5d88bf9
No related branches found
No related tags found
No related merge requests found
......@@ -14,15 +14,23 @@
become: false
when: cephx
- set_fact:
monitor_name: "{{ ansible_hostname }}"
when: not mon_use_fqdn
- set_fact:
monitor_name: "{{ ansible_fqdn }}"
when: mon_use_fqdn
- name: create monitor initial keyring
command: ceph-authtool /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }} --create-keyring --name=mon. --add-key={{ monitor_secret }} --cap mon 'allow *'
command: ceph-authtool /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }} --create-keyring --name=mon. --add-key={{ monitor_secret }} --cap mon 'allow *'
args:
creates: /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
creates: /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }}
when: cephx
- name: set initial monitor key permissions
file:
path: /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
path: /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }}
mode: "{{ key_mode }}"
owner: "{{ key_owner }}"
group: "{{ key_group }}"
......@@ -30,40 +38,40 @@
- name: create monitor directory
file:
path: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}
path: /var/lib/ceph/mon/ceph-{{ monitor_name }}
state: directory
owner: "{{ dir_owner }}"
group: "{{ dir_group }}"
mode: "{{ dir_mode }}"
- name: ceph monitor mkfs with keyring (for or after infernalis release)
command: ceph-mon --setuser ceph --setgroup ceph --mkfs -i {{ ansible_hostname }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
command: ceph-mon --setuser ceph --setgroup ceph --mkfs -i {{ monitor_name }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }}
args:
creates: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring
creates: /var/lib/ceph/mon/ceph-{{ monitor_name }}/keyring
when:
cephx and
is_ceph_infernalis
- name: ceph monitor mkfs without keyring (for or after infernalis release)
command: ceph-mon --setuser ceph --setgroup ceph --mkfs -i {{ ansible_hostname }} --fsid {{ fsid }}
command: ceph-mon --setuser ceph --setgroup ceph --mkfs -i {{ monitor_name }} --fsid {{ fsid }}
args:
creates: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}/store.db
creates: /var/lib/ceph/mon/ceph-{{ monitor_name }}/store.db
when:
not cephx and
is_ceph_infernalis
- name: ceph monitor mkfs with keyring (before infernalis release)
command: ceph-mon --mkfs -i {{ ansible_hostname }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ ansible_hostname }}
command: ceph-mon --mkfs -i {{ monitor_name }} --fsid {{ fsid }} --keyring /var/lib/ceph/tmp/keyring.mon.{{ monitor_name }}
args:
creates: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}/keyring
creates: /var/lib/ceph/mon/ceph-{{ monitor_name }}/keyring
when:
cephx and
not is_ceph_infernalis
- name: ceph monitor mkfs without keyring (before infernalis release)
command: ceph-mon --mkfs -i {{ ansible_hostname }} --fsid {{ fsid }}
command: ceph-mon --mkfs -i {{ monitor_name }} --fsid {{ fsid }}
args:
creates: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}/store.db
creates: /var/lib/ceph/mon/ceph-{{ monitor_name }}/store.db
when:
not cephx and
not is_ceph_infernalis
---
- name: activate monitor with upstart
file:
path: /var/lib/ceph/mon/ceph-{{ ansible_hostname }}/{{ item }}
path: /var/lib/ceph/mon/ceph-{{ monitor_name }}/{{ item }}
state: touch
owner: "{{ activate_file_owner }}"
group: "{{ activate_file_group }}"
......@@ -17,7 +17,7 @@
name: ceph-mon
state: started
enabled: yes
args: "id={{ ansible_hostname }}"
args: "id={{ monitor_name }}"
when: ansible_distribution == "Ubuntu"
# NOTE (leseb): somehow the service ansible module is messing things up
......@@ -32,7 +32,7 @@
- name: enable systemd unit file for mon instance (for or after infernalis)
file:
src: /usr/lib/systemd/system/ceph-mon@.service
dest: /etc/systemd/system/multi-user.target.wants/ceph-mon@{{ ansible_hostname }}.service
dest: /etc/systemd/system/multi-user.target.wants/ceph-mon@{{ monitor_name }}.service
state: link
changed_when: false
failed_when: false
......@@ -42,7 +42,7 @@
- name: start and add that the monitor service to the init sequence (for or after infernalis)
service:
name: ceph-mon@{{ ansible_hostname }}
name: ceph-mon@{{ monitor_name }}
state: started
enabled: yes
changed_when: false
......@@ -51,13 +51,13 @@
is_ceph_infernalis
- name: collect admin and bootstrap keys
command: ceph-create-keys --id {{ ansible_hostname }}
command: ceph-create-keys --id {{ monitor_name }}
changed_when: false
failed_when: false
when: cephx
- name: get ceph monitor version
shell: ceph daemon mon."{{ ansible_hostname }}" version | cut -d '"' -f 4 | cut -f 1,2 -d '.'
shell: ceph daemon mon."{{ monitor_name }}" version | cut -d '"' -f 4 | cut -f 1,2 -d '.'
changed_when: false
failed_when: "'No such file or directory' in ceph_version.stderr"
register: ceph_version
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment