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

Console output escape characters (sometimes) #53

Open
xruth opened this issue Oct 24, 2022 · 1 comment
Open

Console output escape characters (sometimes) #53

xruth opened this issue Oct 24, 2022 · 1 comment

Comments

@xruth
Copy link

xruth commented Oct 24, 2022

Hi!

Creating daily backups from switches and pushing it to a Git repo:

  vars:
        ansible_connection: ansible.netcommon.network_cli
        ansible_network_os: arubanetworks.aos_switch.arubaoss
- hosts: aruba
  serial: 3
  gather_facts: no
  collections:
    - arubanetworks.aos_switch
  tasks:
    - ansible.builtin.include_tasks: backup_aruba_cfg.yml
- name: Get backup from device
  arubaoss_config:
    backup: yes
    backup_options:
      filename: '{{ inventory_hostname }}.cfg'
      dir_path: /network/aruba/

I notice that sometimes escape characters are shown in the output causing a change in Git. A couple of backups later they disappear only to show up again after some time.

Diff from Git:

- vlan 1821
+ �[24;1Hvlan 1821
- �[24;1Hvlan 1821
+ vlan 1821

Not sure if this has to do with your collection though but I thought I will let you know.

Best!
Michael

@tchiapuziowong
Copy link
Member

I've been having difficulty reproducing this issue - can you provide the firmware and model of the switch you're using?

As a workaround you can use Ansible's replace module to replace the characters (if any found) in the file before committing: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/replace_module.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants