title: ansible: get network IP from a host
body: <p>I am using ansible to set up a NFS server on linux machine. I would like to give access to to the /data_to_share directory present on NFS server to all machines sharing the same LAN. This is why I would like to export the NFS at:</p>
  
  <pre><code>/data_to_share      192.168.0.0/24(rw)   
  </code></pre>
  
  <p>With ansible I can get the IP address of the NFS host, using the variable: </p>
  
  <pre><code>{{ ansible_default_ipv4.address }}
  </code></pre>
  
  <p>That would return <code>192.168.0.13</code>. Is there a variable for the network IP, i.e.<code>192.168.0.0</code>, or some other way to get there? thanks </p>