2016-05-06 02:20:03 +08:00
|
|
|
---
|
|
|
|
- name: generate systemd unit file
|
|
|
|
become: true
|
|
|
|
template:
|
2017-02-17 01:31:32 +08:00
|
|
|
src: "{{ role_path }}/templates/ceph-nfs.service.j2"
|
|
|
|
dest: /etc/systemd/system/ceph-nfs@.service
|
2016-05-06 02:20:03 +08:00
|
|
|
owner: "root"
|
|
|
|
group: "root"
|
|
|
|
mode: "0644"
|
|
|
|
|
2017-02-17 01:31:32 +08:00
|
|
|
- name: enable systemd unit file for nfs instance
|
|
|
|
shell: systemctl enable ceph-nfs@{{ ansible_hostname }}.service
|
2016-05-06 02:20:03 +08:00
|
|
|
failed_when: false
|
|
|
|
changed_when: false
|
|
|
|
|
|
|
|
- name: reload systemd unit files
|
|
|
|
shell: systemctl daemon-reload
|
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
|
2017-02-17 01:31:32 +08:00
|
|
|
- name: systemd start nfs container
|
2016-05-06 02:20:03 +08:00
|
|
|
service:
|
|
|
|
name: ceph-nfs@{{ ansible_hostname }}
|
|
|
|
state: started
|
|
|
|
enabled: yes
|
|
|
|
changed_when: false
|