It worked Matt!
Ironically I did try that but it was gather_fact = false and it failed
previously.
Thank you !

Regards,
Sanjay C.

On Tue, Oct 12, 2021 at 9:37 AM Matt Martz <[email protected]> wrote:

> Just replace `{{ item }}` with `{{ ansible_default_ipv4.interface }}` and
> delete the `loop`
>
> On Tue, Oct 12, 2021 at 11:22 AM Sanjay Chakraborty <
> [email protected]> wrote:
>
>> I need to disable ipv6 on the network interface config file. The
>> interface name is not the same for all environments. How I can achieve that
>> ?
>> playbook :
>> ----
>> - name: Disable ipv6 from interface
>>    hosts: groupone
>>    gather_facts: true
>>    ansible.builtin.replace:
>>        path: /etc/sysconfig/network-scripts/ifcfg-{{ item }}
>>        regexp: 'IPV6'
>>        replace: '#IPV6'
>>    loop: "{{ ansible_default_ipv4.interface }}"
>> #Wantlist=True
>> error msg: Invalide data pass to loop.
>>
>>
>> --
>> 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 [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/ansible-project/CAHOFgkSMd8UFRs52BuSn06qEZxSSSHdAMNZNs%3DO4Ypt%2BcWA%3Dww%40mail.gmail.com
>> <https://groups.google.com/d/msgid/ansible-project/CAHOFgkSMd8UFRs52BuSn06qEZxSSSHdAMNZNs%3DO4Ypt%2BcWA%3Dww%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> --
> Matt Martz
> @sivel
> sivel.net
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAD8N0v-RLucN3RTWMwUrMSTo5DxQoeOw6SEYj8MqM4QYQZ-7%2BQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAD8N0v-RLucN3RTWMwUrMSTo5DxQoeOw6SEYj8MqM4QYQZ-7%2BQ%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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAHOFgkScsfXt%2BRC%2BoaPL4SXnH0kqdwN%3D0xemsROtTQLxB9j1xw%40mail.gmail.com.

Reply via email to