August 2019
Beginner
608 pages
16h 7m
English
The NFS exports file is used read by the NFS server at startup to determine which folders should be shared on the network and to which addresses this export is allowed. In the case of our example we want the root folder /nfs to be shared to our GitLab application servers in the 'frontend' Ansible hostgroup. In the Jinja template a for loop is used to iterate through the hostnames of the 'frontend' hostgroup:
/nfs {% for host in groups['frontend'] %} {{ hostvars[host]['inventory_hostname'] }}(rw,sync,no_root_squash,no_subtree_check) {% endfor %}
After processing, the resulting NFS shared filesystem can only be mounted by the application servers.
Read now
Unlock full access