Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long config entries cause incorrect reading of device config #224

Open
lucaelin opened this issue Dec 19, 2021 · 1 comment
Open

Long config entries cause incorrect reading of device config #224

lucaelin opened this issue Dec 19, 2021 · 1 comment

Comments

@lucaelin
Copy link

SUMMARY

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

ISSUE TYPE
  • Bug Report
COMPONENT NAME

vyos_config
terminal

ANSIBLE VERSION
ansible [core 2.11.6] 
  python version = 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0]
  jinja version = 3.0.2
  libyaml = True
COLLECTION VERSION
https://github.com/lucaelin/vyos.vyos
CONFIGURATION

OS / ENVIRONMENT
STEPS TO REPRODUCE
- name: test ssh
  vyos_config:
    lines: 
      - set system login user ansible authentication public-keys ansible key 'veryveryveryveryverylongsshkey=='
EXPECTED RESULTS

The task should be ok when applied multiple times

ACTUAL RESULTS

The task is changed when applied multiple times


@lingfish
Copy link

I have this issue too, seems like a super simple fix?

@NilashishC NilashishC removed their assignment Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants