how to get all the details

IS there is a way that we can get the name of all network interfaces as we have ansible_default_ipv4.interface gives only the primary one . Need to get all the interface name so that a parameter can be modified for it.

ansible_interfaces it's list with all of them.

You can always run "ansible host -m setup" to check all the facts from a host.

thanks Kai, actually trying to edit a parameter in the network interface files I am using something like
lineinfile: “dest=/etc/sysconfig/network-scripts/ifcfg-{{ ansible_default_ipv4.interface }} regexp=‘^{{ item.regexp }}’ line=‘{{
item.line }}’”

but this only gives me the default network card but i want to edit the changes in all the available network interfaces like ifcfg-en0117 or ifcfg-en037 whatever is present in the host except the lo interface…could you please suggest as to how we can do on multiple interface…thank you .

I would use the find module to find ifcfg-* in /etc/sysconfig/network-scripts/ and exclude ifcfg-lo.
Register the output in a variable and loop over the entries in the varaible with with_items on lineinfile.

Thanks Kai, I did the same as suggested by you to find the ifcfg-* but when i register the variable say result. the output of the result variable shows the entire list of attributes of the file, we need to get only the name of the interface but what the output is as below…could you please suggest as to how to curtail the output to give interface name:

the output shows as below :

{
“atime”: 1511964673.1590006,
“ctime”: 1511420044.9254873,
“dev”: 2051,

“isreg”: true,
“issock”: false,
“isuid”: false,
“mode”: “0644”,
“mtime”: 1511420044.9214873,
“nlink”: 1,
“path”: “/etc/sysconfig/network-scripts/ifcfg-eno16777736”,
“rgrp”: true,
“roth”: true,
}

{
“atime”: 1511964673.1320007,
“ctime”: 1511852951.9169016,
“dev”: 2051,
“gid”: 0,
“inode”: 101194774,
“isblk”: false,
“issock”: false

“isuid”: false,
“mode”: “0644”,
“mtime”: 1511852951.9169016,
“nlink”: 1,
“path”: “/etc/sysconfig/network-scripts/ifcfg-Ethernet_connection_1”,
“rgrp”: true,
“roth”: true,
“rusr”: true,
}

- debug: msg="The interface {{ item.path.split('-')[2] }} is configured in {{ item.path }}"
  with_items: '{{ result.files }}'

Thanks Kai for the help.appreciate it

Also want to know , here we are using the result.files , what are the other options we can use…could you please suggest any link where we can get more info about the options available we can use just like results.files

For the find, it's documented at the bottom of the find module documentation page.
For other modules the dictionary is different, most of them is not documented, so the best you can do is check with debug module.

- debug: var=<varaible_name>