2015-07-28 23:15:19 +08:00
|
|
|
---
|
2016-06-03 06:54:56 +08:00
|
|
|
# Use systemd to manage container on Atomic host
|
|
|
|
- name: generate systemd unit file
|
|
|
|
become: true
|
|
|
|
template:
|
2016-06-05 01:56:01 +08:00
|
|
|
src: "{{ role_path }}/templates/ceph-mds.service.j2"
|
2016-06-03 06:54:56 +08:00
|
|
|
dest: /var/lib/ceph/ceph-mds@.service
|
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0644"
|
2016-06-18 00:52:52 +08:00
|
|
|
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
2016-06-03 06:54:56 +08:00
|
|
|
|
|
|
|
- name: link systemd unit file for mds instance
|
|
|
|
file:
|
|
|
|
src: /var/lib/ceph/ceph-mds@.service
|
|
|
|
dest: /etc/systemd/system/multi-user.target.wants/ceph-mds@{{ ansible_hostname }}.service
|
|
|
|
state: link
|
2016-06-18 00:52:52 +08:00
|
|
|
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
2016-06-03 06:54:56 +08:00
|
|
|
|
|
|
|
- name: enable systemd unit file for mds instance
|
2016-06-07 07:49:35 +08:00
|
|
|
command: systemctl enable /etc/systemd/system/multi-user.target.wants/ceph-mds@{{ ansible_hostname }}.service
|
2016-06-03 06:54:56 +08:00
|
|
|
failed_when: false
|
|
|
|
changed_when: false
|
2016-06-18 00:52:52 +08:00
|
|
|
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
2016-06-03 06:54:56 +08:00
|
|
|
|
|
|
|
- name: reload systemd unit files
|
2016-06-07 07:49:35 +08:00
|
|
|
command: systemctl daemon-reload
|
2016-06-03 06:54:56 +08:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
2016-06-18 00:52:52 +08:00
|
|
|
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
2016-06-03 06:54:56 +08:00
|
|
|
|
|
|
|
- name: systemd start mds container
|
|
|
|
service:
|
|
|
|
name: ceph-mds@{{ ansible_hostname }}
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
changed_when: false
|
2016-06-18 00:52:52 +08:00
|
|
|
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
2016-06-03 06:54:56 +08:00
|
|
|
|
2016-05-09 15:12:01 +08:00
|
|
|
- name: run the ceph metadata docker image
|
2015-10-19 10:56:02 +08:00
|
|
|
docker:
|
|
|
|
image: "{{ ceph_mds_docker_username }}/{{ ceph_mds_docker_imagename }}"
|
|
|
|
name: ceph-{{ ansible_hostname }}-mds
|
|
|
|
net: host
|
|
|
|
state: running
|
|
|
|
env: "CEPH_DAEMON=MDS,CEPHFS_CREATE=1,{{ ceph_mds_docker_extra_env }}"
|
|
|
|
volumes: "/var/lib/ceph:/var/lib/ceph,/etc/ceph:/etc/ceph"
|
2016-06-18 00:52:52 +08:00
|
|
|
when: ansible_os_family != 'RedHat' and ansible_os_family != 'CoreOS'
|