On Tue, Jul 21, 2015 at 9:50 AM, Fabrice Bacchella <
[email protected]> wrote:

> On a linux, if I enumerate interfaces using standards tools I get :
> ~# ip link list
> 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
>     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
> 2: eth0: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master
> bond0 state UP qlen 1000
>     link/ether 00:1c:c4:74:83:80 brd ff:ff:ff:ff:ff:ff
> 3: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc mq master
> bond0 state UP qlen 1000
>     link/ether 00:1c:c4:74:83:80 brd ff:ff:ff:ff:ff:ff
> 4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue
> state UP
>     link/ether 00:1c:c4:74:83:80 brd ff:ff:ff:ff:ff:ff
>
>
> ~# cat /proc/net/dev
> Inter-|   Receive                                                |
> Transmit
>  face |bytes    packets errs drop fifo frame compressed multicast|bytes
> packets errs drop fifo colls carrier compressed
>     lo: 3406986600 26540155    0    0    0     0          0         0
> 3406986600 26540155    0    0    0     0       0          0
>   eth0: 40938625356 197161174    0    0    0     0          0   1254629
> 626979237863 480085481    0    0    0     0       0          0
>   eth1: 72695854413 260987060    6    0    0     6          0   1254612
> 699024977778 507216135    0    0    0     0       0          0
>  bond0: 113634479769 458148234    6    0    0     6          0   2509241
> 1326004215641 987301616    0    0    0     0       0          0
>
> I don't use ifconfig any more, it's deprecated since ages.
>
> But with facter I got one more :
> ~# /opt/puppetlabs/bin/facter interfaces
> bond0,bond0:1,eth0,eth1,lo
>
> Because bond0 has two interfaces :
> ~# ip addr list bond0
> 4: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue
> state UP
>     link/ether 00:1c:c4:74:83:80 brd ff:ff:ff:ff:ff:ff
>     inet xxx/20 brd xxxx scope global bond0
>     inet xxx/20 brd xxx scope global secondary bond0:1
>
> In full structured view I get
> networking => {
>   ....
>   interfaces => {
>     bond0 => {
>     },
>     bond0:1 => {
>     },
>   },
> }
>
> I would expect something like:
> networking => {
>   ....
>   interfaces => {
>     bond0 => {
>       [ ip => ]
>       [ ip => ]
>     },
>   },
> }
>
>
> Is that a bug or a feature ?
>
> My view it's bug, because when I ask for interfaces, I mean interfaces,
> not interfaces and friends. But it might be different on other OS.
>

I agree that Facter could do a better job merging the secondary "interface"
into the primary one here.  It shares the networking fact code with a few
other platforms (mainly OSX and the BSDs) and it currently doesn't do any
specific logic for Linux to merge bonded interfaces together.

We could potentially address this in a backwards-compatible way by adding a
"secondary"  field to a interface entry that is an array of the remaining
secondary addresses.  Thus, the "bond0:1" interface would be effectively
moved to "networking.interfaces.bond0.secondary.0".  Would that make sense
to do?


> In full struc
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" 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/puppet-users/C5E27602-09BE-42A1-8040-C7B764116A06%40orange.fr
> <https://groups.google.com/d/msgid/puppet-users/C5E27602-09BE-42A1-8040-C7B764116A06%40orange.fr?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Join us at **PuppetConf 2015, October 5-9 in Portland, OR - *www.
<http://www.google.com/url?q=http%3A%2F%2Fwww.&sa=D&sntz=1&usg=AFQjCNEnS7itqgvQV3E4Se1fu4Um_UapSw>
2015.puppetconf.com
<http://www.google.com/url?q=http%3A%2F%2F2015.puppetconf.com&sa=D&sntz=1&usg=AFQjCNE1uQL4Sh23Vr-XkPLa4xfNcoXSog>

*Register early to save 40%!*

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" 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/puppet-users/CACZQQfMt%3D12KyoCo0iHKPZEHc3eZePCahxUNaUvmKAE20YKo6g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to