I am passing a variable to Ansible with --extra-vars "lan=10.10.10.1".
I now need to increment this IPaddress so that the last octet is .2 so it will equal 10.10.10.2.
How would this be achieved in Ansible?
As of Ansible 2.7 this can be done using IP Math:
{{ lan | ipmath(1) }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With