From b91d227b995a9b87b0864211a74529675b9e17f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 16 Feb 2017 22:13:26 +0100 Subject: [PATCH] docker: make ceph docker osd script path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since distro will not allow /usr/share to be writable (e.g: atomic) so we let the operator decide where to put that script. Signed-off-by: Sébastien Han --- group_vars/osds.yml.sample | 1 + roles/ceph-osd/defaults/main.yml | 1 + roles/ceph-osd/tasks/docker/start_docker_osd.yml | 2 +- roles/ceph-osd/templates/ceph-osd.service.j2 | 2 +- tests/functional/centos/7/docker-cluster/group_vars/all | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/group_vars/osds.yml.sample b/group_vars/osds.yml.sample index 20a234c91..1d154f4a1 100644 --- a/group_vars/osds.yml.sample +++ b/group_vars/osds.yml.sample @@ -193,4 +193,5 @@ dummy: #ceph_osd_docker_devices: "{{ devices }}" #ceph_docker_on_openstack: false #ceph_config_keys: [] # DON'T TOUCH ME +#ceph_osd_docker_run_script_path: "/usr/share" diff --git a/roles/ceph-osd/defaults/main.yml b/roles/ceph-osd/defaults/main.yml index 8672d9ba8..c2713274a 100644 --- a/roles/ceph-osd/defaults/main.yml +++ b/roles/ceph-osd/defaults/main.yml @@ -185,3 +185,4 @@ ceph_osd_docker_extra_env: -e CLUSTER={{ cluster }} -e CEPH_DAEMON=OSD_CEPH_DISK ceph_osd_docker_devices: "{{ devices }}" ceph_docker_on_openstack: false ceph_config_keys: [] # DON'T TOUCH ME +ceph_osd_docker_run_script_path: "/usr/share" diff --git a/roles/ceph-osd/tasks/docker/start_docker_osd.yml b/roles/ceph-osd/tasks/docker/start_docker_osd.yml index 973569e7c..7d1760c19 100644 --- a/roles/ceph-osd/tasks/docker/start_docker_osd.yml +++ b/roles/ceph-osd/tasks/docker/start_docker_osd.yml @@ -71,7 +71,7 @@ become: true template: src: "{{ role_path }}/templates/ceph-osd-run.sh.j2" - dest: /usr/share/ceph-osd-run.sh + dest: "{{ ceph_osd_docker_run_script_path }}/ceph-osd-run.sh" owner: "root" group: "root" mode: "0744" diff --git a/roles/ceph-osd/templates/ceph-osd.service.j2 b/roles/ceph-osd/templates/ceph-osd.service.j2 index cd55833a5..e1b3f43f8 100644 --- a/roles/ceph-osd/templates/ceph-osd.service.j2 +++ b/roles/ceph-osd/templates/ceph-osd.service.j2 @@ -7,7 +7,7 @@ After=docker.service EnvironmentFile=-/etc/environment ExecStartPre=-/usr/bin/docker stop {{ ansible_hostname }}-osd-dev%i ExecStartPre=-/usr/bin/docker rm -f {{ ansible_hostname }}-osd-dev%i -ExecStart=/usr/share/ceph-osd-run.sh %i +ExecStart={{ ceph_osd_docker_run_script_path }}/ceph-osd-run.sh %i ExecStop=-/usr/bin/docker stop {{ ansible_hostname }}-osd-dev%i Restart=always RestartSec=10s diff --git a/tests/functional/centos/7/docker-cluster/group_vars/all b/tests/functional/centos/7/docker-cluster/group_vars/all index 11c3d413f..56cf5cbde 100644 --- a/tests/functional/centos/7/docker-cluster/group_vars/all +++ b/tests/functional/centos/7/docker-cluster/group_vars/all @@ -21,3 +21,4 @@ ceph_osd_docker_devices: "{{ devices }}" devices: - /dev/sda - /dev/sdb +ceph_osd_docker_run_script_path: /var/tmp