{"action":"created","issue":{"url":"https://api.github.com/repos/xaque208/puppet-bsd/issues/79","labels_url":"https://api.github.com/repos/xaque208/puppet-bsd/issues/79/labels{/name}","comments_url":"https://api.github.com/repos/xaque208/puppet-bsd/issues/79/comments","events_url":"https://api.github.com/repos/xaque208/puppet-bsd/issues/79/events","html_url":"https://github.com/xaque208/puppet-bsd/pull/79","id":107699342,"number":79,"title":"Handle parent interfaces","user":{"login":"buzzdeee","id":8383396,"avatar_url":"https://avatars.githubusercontent.com/u/8383396?v=3","gravatar_id":"","url":"https://api.github.com/users/buzzdeee","html_url":"https://github.com/buzzdeee","followers_url":"https://api.github.com/users/buzzdeee/followers","following_url":"https://api.github.com/users/buzzdeee/following{/other_user}","gists_url":"https://api.github.com/users/buzzdeee/gists{/gist_id}","starred_url":"https://api.github.com/users/buzzdeee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buzzdeee/subscriptions","organizations_url":"https://api.github.com/users/buzzdeee/orgs","repos_url":"https://api.github.com/users/buzzdeee/repos","events_url":"https://api.github.com/users/buzzdeee/events{/privacy}","received_events_url":"https://api.github.com/users/buzzdeee/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-22T11:54:33Z","updated_at":"2015-09-28T07:30:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/xaque208/puppet-bsd/pulls/79","html_url":"https://github.com/xaque208/puppet-bsd/pull/79","diff_url":"https://github.com/xaque208/puppet-bsd/pull/79.diff","patch_url":"https://github.com/xaque208/puppet-bsd/pull/79.patch"},"body":"Add a parents parameter to bsd::network::interface. This\r\ncan be a string or an array. The value of that parameter\r\nis passed to Bsd_interface.rb when the interface is started.\r\n\r\nAdd a parents parameter to bsd_interface.rb, and autorequire\r\nthe parents. A bit of validation etc. of the interface name\r\ndone.\r\n\r\nIn bsd::network::interface, require the creation of hostname.if\r\nfor OpenBSD or the shell_config for FreeBSD to be done before\r\nthe Bsd_interface is created.\r\n\r\nThe subclasses in bsd::network::interface::* where parent interfaces\r\nmake sense to set, i.e. bridge, carp, trunk and vlan, deduct the\r\nparent interface based on the interface or device parameter, and\r\nhand that over to the parents parameter of bsd::network::interface.\r\n\r\nSpecs added for bsd::network::interface::* defined types, and\r\nthe parents defined types.\r\n\r\n\r\nTested on one of my soekris boxen, where I created a trunk0 on top of vr1, vr2, vr3.\r\nOn top of trunk0, there is vlan100, and on top of that, there is carp100.\r\n\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface::Vlan[vlan100]/Bsd::Network::Interface[vlan100]/File[/etc/hostname.vlan100]/ensure: created\r\nInfo: /Stage[main]/Profile::Network/Bsd::Network::Interface::Vlan[vlan100]/Bsd::Network::Interface[vlan100]/File[/etc/hostname.vlan100]: Scheduling refresh of Bsd_interface[vlan100]\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface[vr3]/File[/etc/hostname.vr3]/ensure: created\r\nInfo: /Stage[main]/Profile::Network/Bsd::Network::Interface[vr3]/File[/etc/hostname.vr3]: Scheduling refresh of Bsd_interface[vr3]\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface[vr3]/Bsd_interface[vr3]/ensure: created\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface[vr3]/Bsd_interface[vr3]: Triggered 'refresh' from 1 events\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface[vr1]/File[/etc/hostname.vr1]/ensure: created\r\nInfo: /Stage[main]/Profile::Network/Bsd::Network::Interface[vr1]/File[/etc/hostname.vr1]: Scheduling refresh of Bsd_interface[vr1]\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface[vr1]/Bsd_interface[vr1]/ensure: created\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface[vr1]/Bsd_interface[vr1]: Triggered 'refresh' from 1 events\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface::Carp[carp100]/Bsd::Network::Interface[carp100]/File[/etc/hostname.carp100]/ensure: created\r\nInfo: /Stage[main]/Profile::Network/Bsd::Network::Interface::Carp[carp100]/Bsd::Network::Interface[carp100]/File[/etc/hostname.carp100]: Scheduling refresh of Bsd_interface[carp100]\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface[vr2]/File[/etc/hostname.vr2]/ensure: created\r\nInfo: /Stage[main]/Profile::Network/Bsd::Network::Interface[vr2]/File[/etc/hostname.vr2]: Scheduling refresh of Bsd_interface[vr2]\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface[vr2]/Bsd_interface[vr2]/ensure: created\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface[vr2]/Bsd_interface[vr2]: Triggered 'refresh' from 1 events\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface::Trunk[trunk0]/Bsd::Network::Interface[trunk0]/File[/etc/hostname.trunk0]/ensure: created\r\nInfo: /Stage[main]/Profile::Network/Bsd::Network::Interface::Trunk[trunk0]/Bsd::Network::Interface[trunk0]/File[/etc/hostname.trunk0]: Scheduling refresh of Bsd_interface[trunk0]\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface::Trunk[trunk0]/Bsd::Network::Interface[trunk0]/Bsd_interface[trunk0]/ensure: created\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface::Trunk[trunk0]/Bsd::Network::Interface[trunk0]/Bsd_interface[trunk0]: Triggered 'refresh' from 1 events\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface::Vlan[vlan100]/Bsd::Network::Interface[vlan100]/Bsd_interface[vlan100]/ensure: created\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface::Vlan[vlan100]/Bsd::Network::Interface[vlan100]/Bsd_interface[vlan100]: Triggered 'refresh' from 1 events\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface::Carp[carp100]/Bsd::Network::Interface[carp100]/Bsd_interface[carp100]/ensure: created\r\nNotice: /Stage[main]/Profile::Network/Bsd::Network::Interface::Carp[carp100]/Bsd::Network::Interface[carp100]/Bsd_interface[carp100]: Triggered 'refresh' from 1 events\r\n\r\nWithout the autorequire, the carp was created before the vlan, and the vlan before the trunk, leaving a big mess behind ;)\r\n\r\nHowever, I still have some trouble to get the specs test right for bsd_interface.rb. I wanted to test that it bails out when there is a wrong parent name given, and when there is something else given as string or array. Also I wanted to add a test to see that it correctly requires the other parent interfaces before itself, but somehow failed with that. Maybe you can give a hint/idea how to implement the tests properly.\r\n\r\nAt least wanted to show off what I have so far, waiting for feedback ;)\r\n\r\ncheers,"},"comment":{"url":"https://api.github.com/repos/xaque208/puppet-bsd/issues/comments/143660189","html_url":"https://github.com/xaque208/puppet-bsd/pull/79#issuecomment-143660189","issue_url":"https://api.github.com/repos/xaque208/puppet-bsd/issues/79","id":143660189,"user":{"login":"buzzdeee","id":8383396,"avatar_url":"https://avatars.githubusercontent.com/u/8383396?v=3","gravatar_id":"","url":"https://api.github.com/users/buzzdeee","html_url":"https://github.com/buzzdeee","followers_url":"https://api.github.com/users/buzzdeee/followers","following_url":"https://api.github.com/users/buzzdeee/following{/other_user}","gists_url":"https://api.github.com/users/buzzdeee/gists{/gist_id}","starred_url":"https://api.github.com/users/buzzdeee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buzzdeee/subscriptions","organizations_url":"https://api.github.com/users/buzzdeee/orgs","repos_url":"https://api.github.com/users/buzzdeee/repos","events_url":"https://api.github.com/users/buzzdeee/events{/privacy}","received_events_url":"https://api.github.com/users/buzzdeee/received_events","type":"User","site_admin":false},"created_at":"2015-09-28T07:30:23Z","updated_at":"2015-09-28T07:30:23Z","body":"The three points mentioned in my last comment under 'What is missing' should be resolved.\r\nThanks to travis-ci and the added tests, I even fixed a bug that I produced for the FreeBSD case ;)\r\n\r\nWhile updating the README.md, I figured it could use a complete, more structured, rewrite ;)\r\n\r\nI think from my point of view, it should now be ready for merge."}}