Skip to content
ipcalc filter for Ansible to calculate IPv4/IPv6 networks
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

IP Calc for Ansible

Build Status


You need a recent version of ipcalc. On Debian/Ubuntu you can install it with:

sudo apt-get install python-pip
sudo pip install ipcalc


Copy the file to $ansible/filter_plugins/


Example usage in a jinja2 template:

{% set network = "" | ipcalc %}
{{ network.host_min }}

{{ "" | ipadd(3) }} == ""
{{ "fe80::" | ipadd("::3") }} == "fe80::3"
You can’t perform that action at this time.