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

                                  
                          






                                
                                     









                                   

            


                  



                                  

                 
                                        
          
                           
                






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

- name: create hosts directories
  file:
    path: "{{ nfsd_dir }}/{{ item }}"
    owner: 0
    group: 0
    mode: 0777
    state: directory
  loop: "{{ nfsd_shared_dirs }}"

- name: generate nfsd configuration
  template:
    src: exports.j2
    dest: /etc/exports
    owner: 0
    group: 0
    mode: 0640
  register: result

- name: enable and restart portmap
  service: &enable_and_restart
    name: portmap
    state: restarted
    enabled: true

- name: enable and reload/restart mountd
  service:
    <<: *enable_and_restart
    name: mountd
    state: reloaded

- name: enable and restart nfsd
  service:
    <<: *enable_and_restart
    name: nfsd
    state: restarted
remember that computers suck.