Page MenuHomeVyOS Platform

Long config entries cause incorrect reading of device config
Needs testing, NormalPublicBUG

Description

Setting config options with very long entries (>512), cause incorrect reading of the device config. I noticed this when setting the an ssh-rsa pubkey using the vyos_config module, as it would constantly claim that the key I am setting is different from the key found on the device, causing ansible to consider the task as "changed". When looking at the commands that come from the device and get compared to the desired config, I noticed that the 513th character in the line would get replaces by a space.

A dirty fix for this is to increase the terminal width to 1024 in https://github.com/ansible-collections/vyos.vyos/blob/main/plugins/terminal/vyos.py#L70

Details

Version
5.0.0
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)

Event Timeline

Viacheslav triaged this task as Normal priority.Oct 26 2024, 8:36 AM

Are we happy with the above patch (fixing the terminal)?

Hi,
I tested with 520-700+ character long strings and the bug is not evident in 1.3- or1.4+ versions
Can you please re-rest and advise this issue still persist

Thank you

evgmol changed the task status from Open to Needs testing.Mar 11 2025, 11:45 PM

Are we happy with the above patch (fixing the terminal)?

I dont see any link to a patch in this thread?

@Apachez I believe @evgmol was referring to:

https://github.com/ansible-collections/vyos.vyos/blob/main/plugins/terminal/vyos.py#L70

@evgmol I'm not seeing the width of 1024 in that code at this point, looks like it's still 1024. Did I miss the change there?

There was no a change - I tested with the existing code in truck and could not replicate the issue - hence the question, given this is a pretty old bug report