I would like facts to gather CIDR as well as netmask for my IPv4, Its useful for a lot of config files where it doesn’t take 255.255.255.0 but rather only allow /24, like quagga’s ospfd.conf
Sample config:
router ospf
ospf router-id 192.168.0.4
redistribute kernel route-map only-lo
redistribute connected route-map only-lo
network 192.168.0.0/24 area 0.0.0.255
So I want my jinja2 template to have a CIDR variable so I can use:
router ospf
ospf router-id {{ ansible_bond0[‘ipv4’][‘address’] }}
redistribute kernel route-map only-lo
redistribute connected route-map only-lo
network {{ ansible_bond0[‘ipv4’][‘network’] }}{{ ansible_bond0[‘ipv4’][‘cidr’] }} area 0.0.0.255
What do you think?