aboutsummaryrefslogblamecommitdiffstats
path: root/roles/nfsd/tasks/main.yml
blob: 71e9b55d81f1e1ff08b89b7778e469d3439a3a2a (plain) (tree)
1
2
3
4
5
6
7
8
9





                                      

                                              
                         
 


                                    

            





                                     


              




















                                                                          

# nfsd ~~ roles/nfsd/tasks/main.yml
# setup nfs daemon for a list of hosts

---

- name: ensure nfsd required variables are set
  fail:
  when: nsfd_dirs is none

- name: ensure nfsd directory exists
  file:
    path: "{{ nfsd_dir }}"
    owner: 0
    group: 0
    mode: 0700
    state: directory

- name: ensure directories exists
  file:
    path: "{{ nfsd_dir }}/{{ item }}"
    owner: 0
    group: 0
    mode: 0777
    state: directory
  loop: "{{ nfsd_dirs.split(' ') if nfsd_dirs is string else nfsd_dirs }}"

- name: generate /etc/exports configuration
  template:
    src: etc-exports.j2
    dest: /etc/exports
    owner: root
    mode: 0600

- name: include *BSD specific configuration
  include_tasks: "_{{ ansible_distribution | lower }}.yml"

- name: ensure required services are restarted and enabled
  service:
    name: "{{ item }}"
    state: restarted
    enabled: true
  loop:
    - mountd
    - nfsd
remember that computers suck.