Giter VIP home page Giter VIP logo

Comments (5)

pcahyna avatar pcahyna commented on August 22, 2024

what does it mean "when the profile is not completely defined in the profile"? Can you provide an example of such a profile, as a snippet of the network_connections variable?

when the profile is not completely defined in the profile and does not exist on the target system.

What will happen when the profile is not completely defined, but it DOES exist on the target system?

from network.

tyll avatar tyll commented on August 22, 2024

what does it mean "when the profile is not completely defined in the profile"? Can you provide an example of such a profile, as a snippet of the network_connections variable?

It is basically this, just a name and the state:
https://github.com/linux-system-roles/network/blob/master/tests/down-profile.yml

What will happen when the profile is not completely defined, but it DOES exist on the target system?

Then it will now down the profile using ifdown $profile or via Network Manager because all the required information is available.

When interface_name is defined, we can also call ip link set dev $interface state down when the profile is not found but the interface exists to allow to down interfaces for which the profile was already set to absent.

from network.

pcahyna avatar pcahyna commented on August 22, 2024

Currently the role fails when ask to set a profile to down when the profile is not completely defined in the profile and does not exist on the target system. One could argue that a profile is down when it does not exist on the system. However, one could also argue that the role should report this as an error in case there is a typo.

What about reporting an error only if the profile does not exist AND the corresponding interface does not exist either? (By "corresponding interface" I mean the interface determined in the standard way - i.e. match on interface_name (with the default being name) or mac.)
If there is a corresponding interface, then presumably it was not a typo.

from network.

pcahyna avatar pcahyna commented on August 22, 2024

Thinking more about it, I don't think we should worry about typos. Not being able to detect typos in some cases is the price to pay for idempotency, which is one of the key concepts in Ansible. The file module does not report an error with state=absent either, even if the file is not there and the name given could be a typo. This is by design; contrast with the rm command, which can detect typos in this way, but is not idempotent.

from network.

tyll avatar tyll commented on August 22, 2024

Thinking more about it, I don't think we should worry about typos. Not being able to detect typos in some cases is the price to pay for idempotency, which is one of the key concepts in Ansible. The file module does not report an error with state=absent either, even if the file is not there and the name given could be a typo. This is by design; contrast with the rm command, which can detect typos in this way, but is not idempotent.

Ok, let's close this and follow up in #188

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.