Can anyone spot my error here. I have the following in the minion config:
mine_functions:
network.interfaces: []
I expect the following to return the IP of all minions:
{% for ip in salt['mine.get']('*', 'network.interfaces', ['eth0']).items() %}
{{ ip }}
{% endfor %}
The state fails with the following:
Unable to manage file: Jinja error: 'list' object has no attribute 'lower'.
I've also tried doing it another way:
{% set hosts = salt['mine.get']('*', 'network.interfaces') %}
{% for i in hosts %}
{{ hosts[i]['eth0']['inet'][0]['address'] }}
{% endfor %}
From this I get:
variable 'dict object' has no attribute 'inet';
If I remove inet
, 0
and address
it works but outputs all interface info when I only want the IP
of eth0
.
Any help is greatly appreciated.