https://github.com/digineo/ansible-ipcalc
ipcalc filter for Ansible to calculate IPv4/IPv6 networks
https://github.com/digineo/ansible-ipcalc
Last synced: 4 months ago
JSON representation
ipcalc filter for Ansible to calculate IPv4/IPv6 networks
- Host: GitHub
- URL: https://github.com/digineo/ansible-ipcalc
- Owner: digineo
- Created: 2015-01-04T16:03:03.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-04T23:37:52.000Z (over 10 years ago)
- Last Synced: 2025-01-06T15:18:20.623Z (6 months ago)
- Language: Python
- Homepage:
- Size: 148 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
IP Calc for Ansible
===========[](https://travis-ci.org/digineo/ansible-ipcalc)
## Requirements
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## Installation
Copy the file `ipcalc_filter.py` to `$ansible/filter_plugins/`
## Usage
Example usage in a jinja2 template:
{% set network = "172.16.0.1/24" | ipcalc %}
{{ network.host_min }}{{ "192.168.0.1" | ipadd(3) }} == "192.168.0.4"
{{ "fe80::" | ipadd("::3") }} == "fe80::3"