Merge pull request #1983 from jprovaznik/suffix

Allow to override systemd service instance id
pull/2011/head
Sébastien Han 2017-10-06 22:40:57 +02:00 committed by GitHub
commit ac29e8f977
5 changed files with 18 additions and 4 deletions

View File

@ -23,6 +23,13 @@ dummy:
# service is managed by pacemaker # service is managed by pacemaker
#ceph_nfs_enable_service: true #ceph_nfs_enable_service: true
# ceph-nfs systemd service uses ansible's hostname as an instance id,
# so service name is ceph-nfs@{{ ansible_hostname }}, this is not
# ideal when ceph-nfs is managed by pacemaker across multiple hosts - in
# such case it's better to have constant instance id instead which
# can be set by 'ceph_nfs_service_suffix'
# ceph_nfs_service_suffix: ansible_hostname
####################### #######################
# Access type options # # Access type options #
####################### #######################

View File

@ -2,7 +2,7 @@
RETRIES="{{ handler_health_nfs_check_retries }}" RETRIES="{{ handler_health_nfs_check_retries }}"
DELAY="{{ handler_health_nfs_check_delay }}" DELAY="{{ handler_health_nfs_check_delay }}"
NFS_NAME="{{ ansible_hostname }}" NFS_NAME="ceph-nfs@{{ ceph_nfs_service_suffix | default(ansible_hostname) }}"
PID=/var/run/ganesha.pid PID=/var/run/ganesha.pid
{% if containerized_deployment %} {% if containerized_deployment %}
DOCKER_EXEC="docker exec ceph-nfs-{{ ansible_hostname }}" DOCKER_EXEC="docker exec ceph-nfs-{{ ansible_hostname }}"
@ -10,7 +10,7 @@ DOCKER_EXEC="docker exec ceph-nfs-{{ ansible_hostname }}"
# First, restart the daemon # First, restart the daemon
{% if containerized_deployment -%} {% if containerized_deployment -%}
systemctl restart ceph-nfs@${NFS_NAME} systemctl restart $NFS_NAME
COUNT=10 COUNT=10
# Wait and ensure the pid exists after restarting the daemon # Wait and ensure the pid exists after restarting the daemon
while [ $RETRIES -ne 0 ]; do while [ $RETRIES -ne 0 ]; do

View File

@ -15,6 +15,13 @@ copy_admin_key: false
# service is managed by pacemaker # service is managed by pacemaker
ceph_nfs_enable_service: true ceph_nfs_enable_service: true
# ceph-nfs systemd service uses ansible's hostname as an instance id,
# so service name is ceph-nfs@{{ ansible_hostname }}, this is not
# ideal when ceph-nfs is managed by pacemaker across multiple hosts - in
# such case it's better to have constant instance id instead which
# can be set by 'ceph_nfs_service_suffix'
# ceph_nfs_service_suffix: ansible_hostname
####################### #######################
# Access type options # # Access type options #
####################### #######################

View File

@ -51,7 +51,7 @@
- name: systemd start nfs container - name: systemd start nfs container
systemd: systemd:
name: "ceph-nfs@{{ ansible_hostname }}.service" name: ceph-nfs@{{ ceph_nfs_service_suffix | default(ansible_hostname) }}
state: started state: started
enabled: yes enabled: yes
daemon_reload: yes daemon_reload: yes

View File

@ -22,7 +22,7 @@ ExecStart=/usr/bin/docker run --rm --net=host \
-e CLUSTER={{ cluster }} \ -e CLUSTER={{ cluster }} \
-e CEPH_DAEMON=NFS \ -e CEPH_DAEMON=NFS \
{{ ceph_nfs_docker_extra_env }} \ {{ ceph_nfs_docker_extra_env }} \
--name=ceph-nfs-{{ ansible_hostname }} \ --name=ceph-nfs-{{ ceph_nfs_service_suffix | default(ansible_hostname) }} \
{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }} {{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}
ExecStopPost=-/usr/bin/docker stop ceph-nfs-%i ExecStopPost=-/usr/bin/docker stop ceph-nfs-%i
Restart=always Restart=always