Created
March 17, 2020 11:22
-
-
Save filviu/26f2c3c65b0a7d4563d6106318deb592 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First define your dict: | |
nfsmounts: | |
- { path: "/mnt/nfs_mount", src: "192.168.0.55:/nfsshare" } | |
- { path: "/mnt/nfs_mount_2", src: "192.168.0.55:/nfsshare_2" } | |
# Shamelessly lifted from here: | |
# https://stackoverflow.com/questions/45387791/mount-different-shares-from-nfs-on-a-linux-os-using-ansible | |
# Then loop through it: | |
- name: mount the nfsshare in client side | |
mount: | |
fstype: nfs | |
opts: defaults | |
dump: 0 | |
passno: 0 | |
state: mounted | |
src: {{ item.src }} | |
path: "{{ item.path }}" | |
with_items: nfsmounts | |
You can use the dic to parametrize more arguments of mount task too if you want |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment