On Wednesday, 29 November 2017 15.35.03 CET coach rhca wrote:
>
> 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,
> }
- debug: msg="The interface {{ item.path.split('-')[2] }} is configured in {{
item.path }}"
with_items: '{{ result.files }}'
--
Kai Stian Olstad
--
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/2182320.VtXPe1usRS%40x1.
For more options, visit https://groups.google.com/d/optout.