diff --git a/ansible/group_vars/NAS/nfs b/ansible/group_vars/NAS/nfs index 742d77a..91bc44c 100644 --- a/ansible/group_vars/NAS/nfs +++ b/ansible/group_vars/NAS/nfs @@ -1,15 +1,20 @@ nfs_cluster_list: "{% for server in groups['all']%}{{ hostvars[server]['ansible_default_ipv4']['address'] }}(rw,no_root_squash,async,insecure_locks,sec=sys) {%endfor%}" +nfs_consul_service: true +nfs_bind_target: "/exports" +nfs_bind_source: + - /var/local/volume1/nomad + - /var/local/volume1/music + - /var/local/volume1/media + - /var/local/volume1/photo + - /var/local/volume1/ebook nfs_exports: - - "/var/local/volume1/nomad {{nfs_cluster_list}}" - - "/var/local/volume1/music {{nfs_cluster_list}}" - - "/var/local/volume1/media {{nfs_cluster_list}}" - - "/var/local/volume1/photo {{nfs_cluster_list}}" - - "/var/local/volume1/ebook {{nfs_cluster_list}}" - - "/var/local/volume1/git {{nfs_cluster_list}}" - - "/var/local/volume1/archMirror {{nfs_cluster_list}}" - - "/var/local/volume1/homes/admin {{nfs_cluster_list}}" - - "/var/local/volume1/CardDav {{nfs_cluster_list}}" + - "{{nfs_bind_target }} *(fsid=0,insecure,no_subtree_check)" + - "{{ nfs_bind_target }}/nomad {{nfs_cluster_list}}" + - "{{ nfs_bind_target }}/music {{nfs_cluster_list}}" + - "{{ nfs_bind_target }}/media {{nfs_cluster_list}}" + - "{{ nfs_bind_target }}/photo {{nfs_cluster_list}}" + - "{{ nfs_bind_target }}/ebook {{nfs_cluster_list}}" diff --git a/ansible/playbooks/nas.yml b/ansible/playbooks/nas.yml index 67d52d6..9381b7f 100644 --- a/ansible/playbooks/nas.yml +++ b/ansible/playbooks/nas.yml @@ -1,10 +1,20 @@ --- -- hosts: NAS +- name: NAS playbook + hosts: NAS vars: # certbot_force: true + pre_tasks: + - name: Bind NFS export + ansible.posix.mount: + path: "{{ nfs_bind_target }}/{{ item.split('/')[-1] }}" + src: "{{ items }}" + opts: bind + fstype: none + state: mounted + loop: nfs_bind_source roles: - - role: ansible-role-nfs + - role: ansible-role-nfs become: true - - role: ansible-role-vsftpd + - role: ansible-role-vsftpd become: true #- samba