--- - name: populate kv_store with default ceph.conf docker: name: populate-kv-store image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" command: populate_kvstore net: host env: KV_TYPE: "{{kv_type}}" KV_IP: "{{kv_endpoint}}" KV_PORT: "{{kv_port}}" run_once: true when: - "{{ inventory_hostname == groups[mon_group_name][0] }}" - mon_containerized_deployment_with_kv - mon_containerized_default_ceph_conf_with_kv - name: populate kv_store with custom ceph.conf docker: name: populate-kv-store image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" command: populate_kvstore net: host env: KV_TYPE: "{{kv_type}}" KV_IP: "{{kv_endpoint}}" KV_PORT: "{{kv_port}}" volumes: - /etc/ceph/"{{ cluster }}".conf:/etc/ceph/ceph.defaults run_once: true when: - "{{ inventory_hostname == groups[mon_group_name][0] }}" - mon_containerized_deployment_with_kv - not mon_containerized_default_ceph_conf_with_kv - name: delete populate-kv-store docker docker: name: populate-kv-store state: absent image: "{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}" when: mon_containerized_deployment_with_kv - name: generate systemd unit file become: true template: src: "{{ role_path }}/templates/ceph-mon.service.j2" dest: /etc/systemd/system/ceph-mon@.service owner: "root" group: "root" mode: "0644" - name: enable systemd unit file for mon instance shell: systemctl enable ceph-mon@{{ ansible_hostname }}.service failed_when: false changed_when: false - name: reload systemd unit files shell: systemctl daemon-reload changed_when: false failed_when: false - name: systemd start mon container service: name: ceph-mon@{{ ansible_hostname }} state: started enabled: yes changed_when: false