diff --git a/roles/ceph-mon/defaults/main.yml b/roles/ceph-mon/defaults/main.yml index 849bb2f01..b8a496a96 100644 --- a/roles/ceph-mon/defaults/main.yml +++ b/roles/ceph-mon/defaults/main.yml @@ -69,6 +69,7 @@ ceph_mon_docker_interface: eth0 #ceph_mon_docker_subnet: # subnet of the ceph_mon_docker_interface ceph_mon_docker_username: ceph ceph_mon_docker_imagename: daemon +ceph_mon_docker_tag: latest ceph_mon_extra_envs: "MON_NAME={{ ansible_hostname }}" # comma separated variables ceph_docker_on_openstack: false mon_docker_privileged: false diff --git a/roles/ceph-mon/tasks/docker/start_docker_monitor.yml b/roles/ceph-mon/tasks/docker/start_docker_monitor.yml index 535339525..8e85db1ba 100644 --- a/roles/ceph-mon/tasks/docker/start_docker_monitor.yml +++ b/roles/ceph-mon/tasks/docker/start_docker_monitor.yml @@ -2,7 +2,7 @@ - name: populate kv_store with default ceph.conf docker: name: populate-kv-store - image: ceph/daemon + image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_tag }}" command: populate_kvstore net: host env: @@ -18,7 +18,7 @@ - name: populate kv_store with custom ceph.conf docker: name: populate-kv-store - image: ceph/daemon + image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_tag }}" command: populate_kvstore net: host env: @@ -37,7 +37,7 @@ docker: name: populate-kv-store state: absent - image: ceph/daemon + image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_tag }}" when: mon_containerized_deployment_with_kv # Use systemd to manage container on Atomic host and CoreOS @@ -45,21 +45,15 @@ become: true template: src: "{{ role_path }}/templates/ceph-mon.service.j2" - dest: /var/lib/ceph/ceph-mon@.service + dest: /etc/systemd/system/ceph-mon@.service owner: "root" group: "root" mode: "0644" when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS' -- name: link systemd unit file for mon instance - file: - src: /var/lib/ceph/ceph-mon@.service - dest: /etc/systemd/system/multi-user.target.wants/ceph-mon@{{ ansible_hostname }}.service - state: link - when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS' - name: enable systemd unit file for mon instance - shell: systemctl enable /etc/systemd/system/multi-user.target.wants/ceph-mon@{{ ansible_hostname }}.service + shell: systemctl enable ceph-mon@{{ ansible_hostname }}.service failed_when: false changed_when: false when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS' @@ -85,7 +79,7 @@ - name: run the ceph monitor docker image docker: - image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}" + image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_tag }}" name: "{{ ansible_hostname }}" net: "host" state: "running" @@ -99,7 +93,7 @@ - name: run the ceph monitor docker image with kv docker: - image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}" + image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_tag }}" name: "{{ ansible_hostname }}" net: "host" state: "running" diff --git a/roles/ceph-mon/templates/ceph-mon.service.j2 b/roles/ceph-mon/templates/ceph-mon.service.j2 index 110cee457..292089b7f 100644 --- a/roles/ceph-mon/templates/ceph-mon.service.j2 +++ b/roles/ceph-mon/templates/ceph-mon.service.j2 @@ -13,6 +13,7 @@ ExecStart=/usr/bin/docker run --rm --name %i --net=host \ {% else -%} -e KV_TYPE={{kv_type}} \ -e KV_IP={{kv_endpoint}}\ + -e KV_PORT={{kv_port}} \ {% endif -%} {% if mon_docker_privileged -%} --privileged \ @@ -24,7 +25,7 @@ ExecStart=/usr/bin/docker run --rm --name %i --net=host \ -e MON_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface]['ipv4']['address'] }} \ -e CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }} \ -e MON_NAME={{ ansible_hostname }} \ - {{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }} + {{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_tag }} ExecStopPost=-/usr/bin/docker stop %i Restart=always RestartSec=10s