ceph-ansible/roles/ceph-nfs/tasks/docker/start_docker_nfs.yml

51 lines
1.3 KiB
YAML
Raw Normal View History

---
# 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:
path: "/etc/ceph/{{ cluster }}.conf"
when: is_atomic