Skip to content

Conversation

@veyloster
Copy link

SUMMARY

This is about adding a new feature to use commit timer when deploying new config.
Right now there's no option to use it and this is a good mechanism to rollback if a bad configuration is pushed.

ISSUE TYPE

  • Feature Pull Request

ADDITIONAL INFORMATION

Adding a new timer field in the eos_config module which let you set how long you want it to be (Ex: 1m, 30s ...)
You then need to combine this with another task to commit the ansible session.
Other task can be added in between like doing an ssh reset to make sure the device is still reachable after getting the new config.

commit=True,
replace=None,
comment=None,
**kwargs,
Copy link
Contributor

@sc68cal sc68cal Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my only concern around this change is the fact that the only keyword argument that exists is timer - and i think i would rather refactor all the calls to edit_config rather than introduce kwargs to this function.

Copy link

@innerhippy innerhippy Jul 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it's a bit ugly, but if we change the interface and deviate from CliconfBase, then pylint fails. Not sure if the object instance has any state that contains the timer details?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked @Qalthos on Slack and they replied with a bit of insight:

https://ansiblenetwork.slack.com/archives/CEXQ0U2RH/p1689792762886269

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we might be able to do this in edit_config

timer = self.get_option("timer")

But not sure how to test this specific code path.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I will try out that API call and make a PR to update it, if successful

@softwarefactory-project-zuul
Copy link

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/b9dab26e2a38402e9bbd5ddc950c6ada

ansible-test-network-integration-eos-httpapi-python39-stable214 FAILURE in 12m 36s
ansible-test-network-integration-eos-httpapi-python39-stable213 FAILURE in 13m 48s
ansible-test-network-integration-eos-httpapi-python39-stable212 FAILURE in 13m 32s
ansible-test-network-integration-eos-httpapi-python39-stable211 FAILURE in 13m 36s
ansible-test-network-integration-eos-network_cli-python39-stable214-scenario01 FAILURE in 11m 37s (non-voting)
ansible-test-network-integration-eos-network_cli-python39-stable214-scenario02 FAILURE in 12m 12s (non-voting)
ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario01 FAILURE in 12m 07s (non-voting)
ansible-test-network-integration-eos-network_cli-libssh-python39-stable214-scenario02 FAILURE in 12m 03s (non-voting)
ansible-test-network-integration-eos-network_cli-python39-stable213-scenario01 FAILURE in 13m 08s (non-voting)
ansible-test-network-integration-eos-network_cli-python39-stable213-scenario02 FAILURE in 12m 33s (non-voting)
ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario01 FAILURE in 11m 16s (non-voting)
ansible-test-network-integration-eos-network_cli-libssh-python39-stable213-scenario02 FAILURE in 11m 34s (non-voting)
ansible-test-network-integration-eos-network_cli-python39-stable212-scenario01 FAILURE in 11m 09s (non-voting)
ansible-test-network-integration-eos-network_cli-python39-stable212-scenario02 FAILURE in 11m 44s (non-voting)
ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario01 FAILURE in 11m 36s (non-voting)
ansible-test-network-integration-eos-network_cli-libssh-python39-stable212-scenario02 FAILURE in 11m 34s (non-voting)
ansible-test-network-integration-eos-network_cli-python39-stable211-scenario01 FAILURE in 11m 36s (non-voting)
ansible-test-network-integration-eos-network_cli-python39-stable211-scenario02 FAILURE in 11m 57s (non-voting)
ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario01 FAILURE in 11m 20s (non-voting)
ansible-test-network-integration-eos-network_cli-libssh-python39-stable211-scenario02 FAILURE in 11m 47s (non-voting)
✔️ build-ansible-collection SUCCESS in 9m 44s
✔️ ansible-tox-linters SUCCESS in 10m 47s
✔️ ansible-galaxy-importer SUCCESS in 4m 19s

diff_ignore_lines=dict(type="list", elements="str"),
running_config=dict(aliases=["config"]),
intended_config=dict(),
timer=dict(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs a type definition, and if required default value.
timer=dict(type="str" default="")

try:
response = conn.edit_config(commands, commit, replace)
timer = parse_timer(self._module)
response = conn.edit_config(commands, commit, replace, None, timer)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
response = conn.edit_config(commands, commit, replace, None, timer)
response = conn.edit_config(commands, commit, replace,None, timer=timer)

return json.loads(capabilities)


def parse_timer(module):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better place for this would be utils.

@rohitthakur2590
Copy link
Contributor

@veyloster thanks for the work on this feature, I would like to bring more inputs to this,
With this approach if any existing(legacy or resource modules) or new modules want to use this feature we need to expose the timer ; An alternate approach could be having this part of cliconf as an option, which makes it accessible to other modules like eos_banner, user, etc (the ones that are seeing integration test failures).

@pixelrebel
Copy link

@rohitthakur2590 Is there anything I can do to help get this PR back on track? I am using @veyloster 's fork without issues (though I admit, I am only using the eos_config and eos_command modules in my playbooks. IMO, this is an important feature that will give netdevops admins a boost of confidence to use this module widely in production.

@reymonlu
Copy link

reymonlu commented Jun 1, 2025

Hello @rohitthakur2590,

I agree, we are also looking for this kind of functionality. Unfortunately, I don't have the skills to be able to help technically. It would help to be able to deploy. I also think this is an important feature of the module.

@Ruchip16 Ruchip16 marked this pull request as draft August 7, 2025 19:19
@rohitthakur2590
Copy link
Contributor

Hello @rohitthakur2590,

I agree, we are also looking for this kind of functionality. Unfortunately, I don't have the skills to be able to help technically. It would help to be able to deploy. I also think this is an important feature of the module.

@veyloster @pixelrebel @reymonlu Thank you for your patience and all the support on this. We’ve included this work in our upcoming sprint, though there may be some changes to the approach as we refine the solution. @Ruchip16 will be leading the reviews and driving further improvements.

@reymonlu
Copy link

Hello @rohitthakur2590,
I agree, we are also looking for this kind of functionality. Unfortunately, I don't have the skills to be able to help technically. It would help to be able to deploy. I also think this is an important feature of the module.

@veyloster @pixelrebel @reymonlu Thank you for your patience and all the support on this. We’ve included this work in our upcoming sprint, though there may be some changes to the approach as we refine the solution. @Ruchip16 will be leading the reviews and driving further improvements.

Hello,

That's great news. Thank you for taking this into consideration.
I'll test it as soon as it's available.

Thank you.

@Ruchip16 Ruchip16 force-pushed the mdubuc/commit_timer branch from 5381d78 to c10d2aa Compare October 1, 2025 08:35
@Ruchip16 Ruchip16 marked this pull request as ready for review October 1, 2025 08:35
@Ruchip16
Copy link
Member

Ruchip16 commented Oct 2, 2025

putting this PR for hold now as it needs some api changes in netcommon, its giving profile required error and some other errors in ActionBase, so need to dig deeper to update the api calling happening from netcommon, converting to draft for now!

@Ruchip16 Ruchip16 marked this pull request as draft October 2, 2025 19:43
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants