---
- hosts: all
  vars:
    nfslients:
      - 10.1.1.1
      - 10.1.1.2
      - 10.1.1.3
  tasks:
    - action: nfsexport path=/home 
    - action: nfsexport path=/srv clients=$nfsclients options=rw,no_root_squash

# Of course, if you have defined a group you can use the hostnames on
# that group as clients.

- hosts: all
  tasks:
    - action: nfsexport path=/home clients=${groups.myclients}

# Unfortunately, however, there is not (yet) an easy way to convert
# the hostnames into ip addresses.