Allow ceph service systemd overrides to be specified

ceph services can fail to start under certain circumstances (for
example, when running in a container) because the default systemd
service configuration causes namespace issues.

To work around this we can override the system service settings by
placing an overrides file in the ceph-<service>@.service.d directory.
This can be generic so as to allow any potential changes required to
the ceph-<service> service files.

The overrides file is only setup when the
"ceph_<service>_systemd_overrides" config_template override variable is
specified.

The available service systemd override files are as follows:
ceph_mds_systemd_overrides
ceph_mgr_systemd_overrides
ceph_mon_systemd_overrides
ceph_osd_systemd_overrides
ceph_rbd_mirror_systemd_overrides
ceph_rgw_systemd_overrides
pull/1654/head
Andy McCrae 2017-07-05 14:47:48 +01:00
parent 980c324be0
commit 4671b9e74e
24 changed files with 241 additions and 0 deletions

View File

@ -28,3 +28,13 @@ dummy:
#ceph_mds_docker_extra_env: -e CLUSTER={{ cluster }} -e MDS_NAME={{ ansible_hostname }}
#ceph_config_keys: [] # DON'T TOUCH ME
###########
# SYSTEMD #
###########
# ceph_mds_systemd_overrides will override the systemd settings
# for the ceph-mds services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_mds_systemd_overrides:
# Service:
# PrivateDevices: False

View File

@ -14,3 +14,13 @@ dummy:
#ceph_mgr_docker_extra_env: -e CLUSTER={{ cluster }} -e MGR_NAME={{ ansible_hostname }}
#ceph_config_keys: [] # DON'T TOUCH ME
###########
# SYSTEMD #
###########
# ceph_mgr_systemd_overrides will override the systemd settings
# for the ceph-mgr services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_mgr_systemd_overrides:
# Service:
# PrivateDevices: False

View File

@ -125,3 +125,13 @@ dummy:
#mon_docker_net_host: true
#ceph_config_keys: [] # DON'T TOUCH ME
###########
# SYSTEMD #
###########
# ceph_mon_systemd_overrides will override the systemd settings
# for the ceph-mon services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_mon_systemd_overrides:
# Service:
# PrivateDevices: False

View File

@ -246,3 +246,13 @@ dummy:
#ceph_osd_docker_extra_env: -e CLUSTER={{ cluster }} -e OSD_JOURNAL_SIZE={{ journal_size }}
#ceph_osd_docker_run_script_path: "/usr/share" # script called by systemd to run the docker command
###########
# SYSTEMD #
###########
# ceph_osd_systemd_overrides will override the systemd settings
# for the ceph-osd services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_osd_systemd_overrides:
# Service:
# PrivateDevices: False

View File

@ -44,3 +44,14 @@ dummy:
#ceph_config_keys: [] # DON'T TOUCH ME
###########
# SYSTEMD #
###########
# ceph_rbd_mirror_systemd_overrides will override the systemd settings
# for the ceph-rbd-mirror services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_rbd_mirror_systemd_overrides:
# Service:
# PrivateDevices: False

View File

@ -60,3 +60,13 @@ dummy:
#ceph_config_keys: [] # DON'T TOUCH ME
#rgw_config_keys: "/" # DON'T TOUCH ME
###########
# SYSTEMD #
###########
# ceph_rgw_systemd_overrides will override the systemd settings
# for the ceph-rgw services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_rgw_systemd_overrides:
# Service:
# PrivateDevices: False

View File

@ -19,3 +19,14 @@ copy_admin_key: false
ceph_mds_docker_extra_env: -e CLUSTER={{ cluster }} -e MDS_NAME={{ ansible_hostname }}
ceph_config_keys: [] # DON'T TOUCH ME
###########
# SYSTEMD #
###########
# ceph_mds_systemd_overrides will override the systemd settings
# for the ceph-mds services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_mds_systemd_overrides:
# Service:
# PrivateDevices: False

View File

@ -44,6 +44,24 @@
mode: "0600"
when: cephx
- name: ensure systemd service override directory exists
file:
state: directory
path: "/etc/systemd/system/ceph-mds@.service.d/"
when:
- ceph_mds_systemd_overrides is defined
- ansible_server_mgr == 'systemd'
- name: add ceph-mds systemd service overrides
config_template:
src: "ceph-mds.service.d-overrides.j2"
dest: "/etc/systemd/system/ceph-mds@.service.d/ceph-mds-systemd-overrides.conf"
config_overrides: "{{ ceph_mds_systemd_overrides | default({}) }}"
config_type: "ini"
when:
- ceph_mds_systemd_overrides is defined
- ansible_service_mgr == 'systemd'
- name: start and add that the metadata service to the init sequence
service:
name: ceph-mds@{{ mds_name }}

View File

@ -0,0 +1 @@
# {{ ansible_managed }}

View File

@ -5,3 +5,14 @@
ceph_mgr_docker_extra_env: -e CLUSTER={{ cluster }} -e MGR_NAME={{ ansible_hostname }}
ceph_config_keys: [] # DON'T TOUCH ME
###########
# SYSTEMD #
###########
# ceph_mgr_systemd_overrides will override the systemd settings
# for the ceph-mgr services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_mgr_systemd_overrides:
# Service:
# PrivateDevices: False

View File

@ -34,6 +34,24 @@
when:
- cephx
- name: ensure systemd service override directory exists
file:
state: directory
path: "/etc/systemd/system/ceph-mgr@.service.d/"
when:
- ceph_mgr_systemd_overrides is defined
- ansible_service_mgr == 'systemd'
- name: add ceph-mgr systemd service overrides
config_template:
src: "ceph-mgr.service.d-overrides.j2"
dest: "/etc/systemd/system/ceph-mgr@.service.d/ceph-mgr-systemd-overrides.conf"
config_overrides: "{{ ceph_mgr_systemd_overrides | default({}) }}"
config_type: "ini"
when:
- ceph_mgr_systemd_overrides is defined
- ansible_service_mgr == 'systemd'
- name: start and add that the mgr service to the init sequence
service:
name: "ceph-mgr@{{ ansible_hostname }}"

View File

@ -0,0 +1 @@
# {{ ansible_managed }}

View File

@ -116,3 +116,14 @@ ceph_mon_docker_extra_env: -e CLUSTER={{ cluster }} -e FSID={{ fsid }} -e MON_NA
mon_docker_privileged: false
mon_docker_net_host: true
ceph_config_keys: [] # DON'T TOUCH ME
###########
# SYSTEMD #
###########
# ceph_mon_systemd_overrides will override the systemd settings
# for the ceph-mon services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_mon_systemd_overrides:
# Service:
# PrivateDevices: False

View File

@ -1,4 +1,22 @@
---
- name: ensure systemd service override directory exists
file:
state: directory
path: "/etc/systemd/system/ceph-mon@.service.d/"
when:
- ceph_mon_systemd_overrides is defined
- ansible_service_mgr == 'systemd'
- name: add ceph-mon systemd service overrides
config_template:
src: "ceph-mon.service.d-overrides.j2"
dest: "/etc/systemd/system/ceph-mon@.service.d/ceph-mon-systemd-overrides.conf"
config_overrides: "{{ ceph_mon_systemd_overrides | default({}) }}"
config_type: "ini"
when:
- ceph_mon_systemd_overrides is defined
- ansible_service_mgr == 'systemd'
- name: start the monitor service
service:
name: ceph-mon@{{ monitor_name }}

View File

@ -0,0 +1 @@
# {{ ansible_managed }}

View File

@ -238,3 +238,14 @@ ceph_osd_docker_prepare_env: -e CLUSTER={{ cluster }} -e OSD_JOURNAL_SIZE={{ jou
#
ceph_osd_docker_extra_env: -e CLUSTER={{ cluster }} -e OSD_JOURNAL_SIZE={{ journal_size }}
ceph_osd_docker_run_script_path: "/usr/share" # script called by systemd to run the docker command
###########
# SYSTEMD #
###########
# ceph_osd_systemd_overrides will override the systemd settings
# for the ceph-osd services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_osd_systemd_overrides:
# Service:
# PrivateDevices: False

View File

@ -10,6 +10,24 @@
always_run: true
register: osd_id
- name: ensure systemd service override directory exists
file:
state: directory
path: "/etc/systemd/system/ceph-osd@.service.d/"
when:
- ceph_osd_systemd_overrides is defined
- ansible_service_mgr == 'systemd'
- name: add ceph-osd systemd service overrides
config_template:
src: "ceph-osd.service.d-overrides.j2"
dest: "/etc/systemd/system/ceph-osd@.service.d/ceph-osd-systemd-overrides.conf"
config_overrides: "{{ ceph_osd_systemd_overrides | default({}) }}"
config_type: "ini"
when:
- ceph_osd_systemd_overrides is defined
- ansible_service_mgr == 'systemd'
- name: ensure osd daemons are started
service:
name: ceph-osd@{{ item }}

View File

@ -0,0 +1 @@
# {{ ansible_managed }}

View File

@ -35,3 +35,14 @@ ceph_rbd_mirror_pool: ""
##########
ceph_config_keys: [] # DON'T TOUCH ME
###########
# SYSTEMD #
###########
# ceph_rbd_mirror_systemd_overrides will override the systemd settings
# for the ceph-rbd-mirror services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_rbd_mirror_systemd_overrides:
# Service:
# PrivateDevices: False

View File

@ -1,4 +1,22 @@
---
- name: ensure systemd service override directory exists
file:
state: directory
path: "/etc/systemd/system/ceph-rbd-mirror@.service.d/"
when:
- ceph_rbd_mirror_systemd_overrides is defined
- ansible_service_mgr == 'systemd'
- name: add ceph-rbd-mirror systemd service overrides
config_template:
src: "ceph-rbd-mirror.service.d-overrides.j2"
dest: "/etc/systemd/system/ceph-rbd-mirror@.service.d/ceph-rbd-mirror-systemd-overrides.conf"
config_overrides: "{{ ceph_rbd_mirror_systemd_overrides | default({}) }}"
config_type: "ini"
when:
- ceph_rbd_mirror_systemd_overrides is defined
- ansible_service_mgr == 'systemd'
- name: start and add that the rbd mirror service to the init sequence
service:
name: "ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}"

View File

@ -0,0 +1 @@
# {{ ansible_managed }}

View File

@ -51,3 +51,14 @@ ceph_rgw_civetweb_port: "{{ radosgw_civetweb_port }}"
ceph_rgw_docker_extra_env: -e CLUSTER={{ cluster }} -e RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }}
ceph_config_keys: [] # DON'T TOUCH ME
rgw_config_keys: "/" # DON'T TOUCH ME
###########
# SYSTEMD #
###########
# ceph_rgw_systemd_overrides will override the systemd settings
# for the ceph-rgw services.
# For example,to set "PrivateDevices=false" you can specify:
#ceph_rgw_systemd_overrides:
# Service:
# PrivateDevices: False

View File

@ -6,6 +6,24 @@
failed_when: false
always_run: true
- name: ensure systemd service override directory exists
file:
state: directory
path: "/etc/systemd/system/ceph-rgw@.service.d/"
when:
- ceph_rgw_systemd_overrides is defined
- ansible_service_mgr == 'systemd'
- name: add ceph-rgw systemd service overrides
config_template:
src: "ceph-rgw.service.d-overrides.j2"
dest: "/etc/systemd/system/ceph-rgw@.service.d/ceph-rgw-systemd-overrides.conf"
config_overrides: "{{ ceph_rgw_systemd_overrides | default({}) }}"
config_type: "ini"
when:
- ceph_rgw_systemd_overrides is defined
- ansible_service_mgr == 'systemd'
- name: start rgw
service:
name: ceph-radosgw@rgw.{{ ansible_hostname }}

View File

@ -0,0 +1 @@
# {{ ansible_managed }}