mirror of https://github.com/ceph/ceph-ansible.git
docker: use systemd to manage container
Since we now only support systemd has an init system we can finally treat containers as processes using systemd and this for all the distros. Signed-off-by: Sébastien Han <seb@redhat.com>pull/1278/head
parent
88a2b2de8c
commit
57e6edff98
|
@ -8,26 +8,22 @@
|
|||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- 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
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: enable systemd unit file for mds instance
|
||||
command: systemctl enable /etc/systemd/system/multi-user.target.wants/ceph-mds@{{ ansible_hostname }}.service
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: reload systemd unit files
|
||||
command: systemctl daemon-reload
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: systemd start mds container
|
||||
service:
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}:{{ ceph_mon_docker_image_tag }}"
|
||||
when: mon_containerized_deployment_with_kv
|
||||
|
||||
# Use systemd to manage container on Atomic host and CoreOS
|
||||
- name: generate systemd unit file
|
||||
become: true
|
||||
template:
|
||||
|
@ -49,19 +48,16 @@
|
|||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: enable systemd unit file for mon instance
|
||||
shell: systemctl enable ceph-mon@{{ ansible_hostname }}.service
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: reload systemd unit files
|
||||
shell: systemctl daemon-reload
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: systemd start mon container
|
||||
service:
|
||||
|
|
|
@ -8,34 +8,22 @@
|
|||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
when:
|
||||
is_atomic or
|
||||
ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: link systemd unit file for NFS instance
|
||||
file:
|
||||
src: /var/lib/nfs/ganesha/ceph-nfs@.service
|
||||
dest: /etc/systemd/system/multi-user.target.wants/ceph-nfs@{{ ansible_hostname }}.service
|
||||
state: link
|
||||
when:
|
||||
is_atomic or
|
||||
ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: enable systemd unit file for NFS instance
|
||||
shell: systemctl enable /etc/systemd/system/multi-user.target.wants/ceph-nfs@{{ ansible_hostname }}.service
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
when:
|
||||
is_atomic or
|
||||
ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: reload systemd unit files
|
||||
shell: systemctl daemon-reload
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
when:
|
||||
is_atomic or
|
||||
ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: systemd start NFS container
|
||||
service:
|
||||
|
|
|
@ -67,7 +67,6 @@
|
|||
- ceph_osd_docker_prepare_env is defined
|
||||
- osd_containerized_deployment_with_kv
|
||||
|
||||
# Use systemd to manage container on appropriate host
|
||||
- name: generate systemd unit file
|
||||
become: true
|
||||
template:
|
||||
|
@ -77,20 +76,17 @@
|
|||
group: "root"
|
||||
mode: "0644"
|
||||
failed_when: false
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: enable systemd unit file for osd instance
|
||||
shell: systemctl enable ceph-osd@{{ item | basename }}.service
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
with_items: "{{ ceph_osd_docker_devices }}"
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: reload systemd unit files
|
||||
shell: systemctl daemon-reload
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: systemd start osd container
|
||||
service:
|
||||
|
|
|
@ -8,19 +8,16 @@
|
|||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: enable systemd unit file for rbd mirror instance
|
||||
command: systemctl enable ceph-rbd-mirror@{{ ansible_hostname }}.service
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: reload systemd unit files
|
||||
command: systemctl daemon-reload
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: systemd start rbd mirror container
|
||||
service:
|
||||
|
|
|
@ -8,26 +8,22 @@
|
|||
owner: "root"
|
||||
group: "root"
|
||||
mode: "0644"
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: link systemd unit file for rgw instance
|
||||
file:
|
||||
src: /var/lib/ceph/ceph-rgw@.service
|
||||
dest: /etc/systemd/system/multi-user.target.wants/ceph-rgw@{{ ansible_hostname }}.service
|
||||
state: link
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: enable systemd unit file for rgw instance
|
||||
shell: systemctl enable /etc/systemd/system/multi-user.target.wants/ceph-rgw@{{ ansible_hostname }}.service
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: reload systemd unit files
|
||||
shell: systemctl daemon-reload
|
||||
changed_when: false
|
||||
failed_when: false
|
||||
when: ansible_os_family == 'RedHat' or ansible_os_family == 'CoreOS'
|
||||
|
||||
- name: systemd start rgw container
|
||||
service:
|
||||
|
|
Loading…
Reference in New Issue