Dumping a given fact for all hosts could be done something like this:
- hosts: all
gather_facts: True
tasks: []
- hosts: localhost
tasks:
- template: src=maclist.j2 dest=/tmp/maclist.j2
{% for host in groups['all'] % }
{{ host }} - {{ hostvars[host]['whatever_variable'] }}
{% endfor %}
This was typed quickly and may have a typo in it.
See "ansible hostname -m setup" to list all facts available for a host.
Some extra template logic would be necessary to walk the network interfaces.
On Thu, Sep 25, 2014 at 5:40 PM, Kyle Hopfensperger <[email protected]>
wrote:
> Hello,
>
> I am wondering if there is a way to list all MAC addresses assigned to
> each interface device found through setup? What I am looking to do is edit
> the /etc/udev/rules.d/70-persistent-net.rules file to assign each detected
> interface after eth0 and apply the MAC address associated with it. It works
> perfectly for /etc/network/interfaces (
> https://gist.github.com/analytically/5760207 ). If there isn't a way I
> can always create a script, but I feel its safer to go through ansible on
> updating this instead of running a script each time the playbook is ran.
>
>
> Thanks,
> Kyle
>
> --
> 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/88599501-17eb-461f-b101-1a3f005a1831%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/88599501-17eb-461f-b101-1a3f005a1831%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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/CA%2BnsWgzSb7yDdKQDRNqLHUpubYuCO4FMSxEGAvU5cPzTOoVZZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.