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

   
                                  
                       
                          

            
                


                                
                       
                                     

            
                



                                   
                           

                      

            
                

                  
                                  
                                              

                    

                 
                                        
                          
                           
                


                               
                          


                           
---

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

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

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

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

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

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