2016-05-06 02:20:03 +08:00
|
|
|
---
|
|
|
|
# Use systemd to manage container on Atomic host and CoreOS
|
|
|
|
- name: generate systemd unit file
|
|
|
|
become: true
|
|
|
|
template:
|
|
|
|
src: "{{ playbook_dir }}/roles/ceph-nfs/templates/ceph-nfs.service.j2"
|
|
|
|
dest: /var/lib/nfs/ganesha/ceph-nfs@.service
|
|
|
|
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:
|
|
|
|
name: ceph-nfs@{{ ansible_hostname }}
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
changed_when: false
|
|
|
|
|
|
|
|
- name: wait for ceph.conf exists
|
|
|
|
wait_for:
|
2016-08-23 18:03:05 +08:00
|
|
|
path: "/etc/ceph/{{ cluster }}.conf"
|
2016-05-06 02:20:03 +08:00
|
|
|
when: is_atomic
|