I hadn't heard about any inconsistencies either, which is why I figured I'd
ask here.  I thought about the ipaddr filter, but you need to install a
python module for it to work. (netaddr I think) and I was just trying to
figure it out using the base set of modules, etc.  Thanks for the info
though, I appreciate it

--John

On Thu, Oct 21, 2021, 7:43 PM Dick Visser <dick.vis...@geant.org> wrote:

> I don't know about any such unreliability.
> As for determining if the address is in a specific prefix, I would
> definitely use the ipaddr filter:
>
> https://docs.ansible.com/ansible/latest/user_guide/playbooks_filters_ipaddr.html
>
> On Fri, 22 Oct 2021 at 00:06, John Petro <jcpe...@johnpetro.com> wrote:
>
>> Good afternoon.
>>   I have this snippet of code, that sets a proxy variable if the default
>> ipv4 IP address is in 10 net space.  I had read somewhere that using the
>> ansible_default_ipv4 fact, wasn't always reliable.  So is there a better
>> way to grab the primary IP other than what I did below?
>>
>> - name:  PreTask | Configure proxy
>>   set_fact:
>>     _zabbix_proxy: "{{zabbix_http_proxy}}"
>>   when: hostvars[inventory_hostname]['ansible_default_ipv4']['address'] |
>> select('match', '^10.[0-9]+')
>>
>> Thanks for the help!!
>>
>> --John
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Ansible Project" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to ansible-project+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAPAjob_VTLnFFUannftz9cgMbdGj7etHN8TtmA%2B%2B7M7aA7L8qg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CAPAjob_VTLnFFUannftz9cgMbdGj7etHN8TtmA%2B%2B7M7aA7L8qg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> Sent from a mobile device - please excuse the brevity, spelling and
> punctuation.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAL8fbwMpKBNdfM1FtH4-FemVx_FW1hNk03uwXeLW%2Bv5esTiGcQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAL8fbwMpKBNdfM1FtH4-FemVx_FW1hNk03uwXeLW%2Bv5esTiGcQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPAjob922AxOR0_mS-G230o33_i6HD9bhPDxxjEN3Sg%2BKtKLzQ%40mail.gmail.com.

Reply via email to