Giter VIP home page Giter VIP logo

Comments (16)

codetronaut avatar codetronaut commented on July 21, 2024

Hello, I would like to work on this issue. Please give me some follow-ups.

from network.

pcahyna avatar pcahyna commented on July 21, 2024

@codetronaut great! @thom311 @tyll could you please give advice? By the way, using the CheckPoint feature is already implemented in #119 , I believe.

from network.

pcahyna avatar pcahyna commented on July 21, 2024

@codetronaut from a quick look I think the best place to start would be to read about the CheckPoint feature referenced above and look in PR #119 to see how it is used in the network role (in the internal module which implements most of the functionality, which is here: https://github.com/linux-system-roles/network/blob/master/library/network_connections.py). Then you could modify the module to introduce a timeout, after which the state is rolled back. And introduce a new operation which would cancel the timeout. Finally, you would change the Ansible parts of the role so that it calls the module asynchronously, then reconnects and invokes the cancellation of the timeout. (Unless the maintainers have different suggestions.)

from network.

thom311 avatar thom311 commented on July 21, 2024

I think the important bit here are how to implement async modules. It's more a question about ansible module development... I am not familiar with it, but I'd look how other modules handle that. For example, how can the SSH module change the port? How does reboot work?

from network.

pcahyna avatar pcahyna commented on July 21, 2024

An example of a test which reboots the managed host can be seen here:
https://github.com/linux-system-roles/selinux/blob/6cd1ec8fdebdb92a789b14e5a44fe77f0a3d8ecd/tests/selinux_apply_reboot.yml#L12

from network.

pcahyna avatar pcahyna commented on July 21, 2024

here is some information about async tasks: https://docs.ansible.com/ansible/latest/user_guide/playbooks_async.html

from network.

pcahyna avatar pcahyna commented on July 21, 2024

@thom311 what is the SSH module? I don't see it in the module index.

from network.

codetronaut avatar codetronaut commented on July 21, 2024

@pcahyna will check the #119.
will ask if get stuck :)
Also, I am a little beginner but will do my best to resolve this issue.

from network.

pcahyna avatar pcahyna commented on July 21, 2024

@codetronaut in this case, because most of the role functionality is implemented in an Ansible module, the Ansible documentation about developing modules could be useful: https://docs.ansible.com/ansible/latest/dev_guide/index.html

from network.

pcahyna avatar pcahyna commented on July 21, 2024

@codetronaut you don't need to dive too much into the details of Ansible module development though, as you are not developing a module from scratch, the module already exists and you will need to only extend it a bit.

from network.

codetronaut avatar codetronaut commented on July 21, 2024

sure @pcahyna , will do it.

from network.

pcahyna avatar pcahyna commented on July 21, 2024

@codetronaut : @tyll uncovered some problems in the checkpoint implementation, see #154, so the code in #119 is likely to get changed.

from network.

codetronaut avatar codetronaut commented on July 21, 2024

Sure.

from network.

codetronaut avatar codetronaut commented on July 21, 2024

Then you could modify the module to introduce a timeout, after which the state is rolled back. And introduce a new operation which would cancel the timeout.

please guide me for this, I understand the part after the creation of the module i.e to insert into the ansible's python file.

from network.

tyll avatar tyll commented on July 21, 2024

@codetronaut thank you for your patience. I just submitted a PR to fix the current bug in the implementation (#193) and I thought about this feature. IMHO the next step after the bug is fixed is to refactor the code to

  1. Not to commit/destroy the checkpoint directly in the module when the transaction is complete but instead to return the dbus path of the checkpoint (for example /org/freedesktop/NetworkManager/Checkpoint/66)
  2. Add another step in the role tasks file after the current call of the module to destroy the checkpoint. Maybe it can just be a command like

gdbus call --system --dest org.freedesktop.NetworkManager --object-path /org/freedesktop/NetworkManager --method org.freedesktop.NetworkManager.CheckpointDestroy /org/freedesktop/NetworkManager/Checkpoint/66

when the network_provider is nm.

Afterwards we can consider additional checks that would call CheckpointRollback after doing a specific check. This needs further discussion. What do you think? (also @pcahyna or @thom311 please comment).

from network.

tyll avatar tyll commented on July 21, 2024

Actually my comment probably belongs better to #123 but this all needs to play well together.

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.