Giter Site home page Giter Site logo

Comments (9)

thom311 avatar thom311 commented on August 17, 2024

cool, thanks for reporting

Regarding initscripts support... there are various initscripts flavours, like Fedora/RHEL, SuSE. For the moment, the role only targets the Fedora/RHEL flavour, simply because there is no testing happening for other distros. So, unless somebody shows serious interest in testing and fixing initscripts for other distros, I'd rather not merge any patches that create initscripts that won't work on Fedora/RHEL. The referenced initscripts-macvlan is also not part of RHEL, so the same applies. But we can add macvlan support for NetworkManager only. Of course, optimally all providers support all options, but that is not a hard rule. I think Cmd_initscripts should overload run_prepare() and error out when encountering a macvlan device.

Regarding the patch, a few comments:

  • I think it shouldn't add a macvlan_parent property, but reuse the existing parent, like for vlan.

  • Regarding macvlan_mode, it is the same style as VLAN's vlan_id. I am no longer convinced this was the right decision, and would prefer that such properties are nested like

   - type: "macvlan"
   - parent: "eth0"
   - macvlan:
       - mode: "bridge"

How about that? Look at ArgValidator_DictBond() which does the same for bonds.

If you are willing, please open a pull request. Thanks!

from network.

rpabel avatar rpabel commented on August 17, 2024
  • I am totally fine with this not working with initscripts (for now... or ever). I'll take out that part of the patch and see that I add a check for macvlans in Cmd_initscripts.

  • I can certainly create a ArgValidator_DictMacvlanModes class and change the structure of the parameters as you described. Right now, all modes have to be specified twice (in NMUtil and ArgValidator_DictConnection), the mode names should be private to this class only then, which is preferable.

  • I first tried using "parent" for the macvlan_parent, but parent parameter is checked to be a valid connection in a several places, e.g.:
    ArgUtil.connection_find_by_name(connection['parent'], result, idx)
    But for macvlan, the parent can be an unmanaged device. nmcli calls the option "dev" and allows
    dev <parent device (connection UUID, ifname, or MAC)>
    I only called it "parent" because that is the name the libnm uses: NM.SETTING_MACVLAN_PARENT.
    I agree reusing the parameter parent is favorable, but it would mean touching lots of other lines...

I'll get on it and prepare another patch.

from network.

thom311 avatar thom311 commented on August 17, 2024

ArgValidator_DictMacvlanModes should be ArgValidator_DictMacvlan.

I first tried using "parent" for the macvlan_parent, but parent parameter is checked to be a valid
connection in a several places, e.g.:

Yeah, that's intended. As far as NetworkManager is concerned, you can create a VLAN/MACVlan with a parent that is not managed by NetworkManager. The "parent" either references an interface-name or the UUID or another connection profile.
For the role, the "parent" is always the name of another profile in the same play, like

     - name: wired
       type: ethernet
       interface_name: eth0
     - name: wired.100
       type: vlan
       parent: wired
       vlan_id: 100

so, you need to define the parent as well, otherwise, we wouldn't know which interface-name/UUID to set in NetworkManager. In the playbook, when a profile references another profile (either via parent or master), that other profile must also be fully declared in the same playbook. I think that restriction makes sense.

from network.

rpabel avatar rpabel commented on August 17, 2024

I think that restriction makes sense.

It does. I personally would prefer to have the same functionality regardless whether it's ansible or nmcli. In my case, the ethernet interface was unmanaged so far, but I found that assigning an ip address on the subnet with mask /32 makes it all work (ansible is happy and routing works). So this is an easy workaround.

from network.

thom311 avatar thom311 commented on August 17, 2024

Note #26 which reworks vlan / infiniband handling. I think macvlan also should use such a nested setting like bond

from network.

rpabel avatar rpabel commented on August 17, 2024

Yes, I've done that and also added the other two (boolean) options: "promiscuous" and "tap". Will send the patch today.

from network.

rpabel avatar rpabel commented on August 17, 2024

I think I sent you the pull request last week (I haven't used github before, so I could have done something wrong), did you have a chance to look at it?

from network.

thom311 avatar thom311 commented on August 17, 2024

I think I sent you the pull request last week (I haven't used github before, so I could have done something wrong), did you have a chance to look at it?

Right. Thanks for the reminder. Replied at #27.

(you can just --force re-push the branch, the pull request will automatically get updated.

from network.

thom311 avatar thom311 commented on August 17, 2024

Fixed with pull request #27

from network.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.