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

edgeos_config detects changes where there are none #198

Open
jplitza opened this issue Feb 1, 2021 · 4 comments
Open

edgeos_config detects changes where there are none #198

jplitza opened this issue Feb 1, 2021 · 4 comments
Labels
affects_2.9 bug This issue/PR relates to a bug module module needs_triage plugins plugin (any type) python3

Comments

@jplitza
Copy link
Contributor

jplitza commented Feb 1, 2021

SUMMARY

When not passing save: yes to edgeos_config, it assumes that a delete command that matches existing configuration actually means a change. However, if the same configuration is re-added later, nothing really changes (not even transiently, because all chnages are committed together)

ISSUE TYPE
  • Bug Report
COMPONENT NAME

edgeos_config

ANSIBLE VERSION
ansible 2.9.10
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/.local/lib/python3.6/site-packages/ansible
  executable location = /home/user/.local/bin/ansible
  python version = 3.6.9 (default, Oct  8 2020, 12:12:24) [GCC 8.4.0]
CONFIGURATION

OS / ENVIRONMENT

Ubuntu 18.04

STEPS TO REPRODUCE
- hosts: all
  tasks:
  - edgeos_config:
      lines:
      - "delete system name-server"
      - "set system name-server 208.67.220.220"
  - edgeos_config:
      lines:
      - "delete system name-server"
      - "set system name-server 208.67.220.220"
EXPECTED RESULTS

The first task might change something, but the second effectively won't, because all settings are restored after the delete. This is actually useful to assert no other config exists at the same level (e.g. system name-servers, interface address, ...)

ACTUAL RESULTS

Both tasks supposedly change something.

ADDITIONAL NOTES

Currently, the module tries to determine which commands are necessary to execute in order to achieve the desired configuration by comparing the current (or provided) config with the commands in the invocation. Extending this to cover cases like these would certainly be possible, but an approximation at best.

In #184, support for diffs was added using the compare command. So I think it would be reasonable to use the compare command to determine changed status as well, since this is definitive: If that doesn't output any changes, the router won't change any configuration. Currently, it's possible to have changed: true but an empty diff.

@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot
Copy link
Collaborator

@jplitza, just so you are aware we have a dedicated Working Group for network.
You can find other people interested in this in #ansible-network on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibullbot ansibullbot added affects_2.9 bug This issue/PR relates to a bug module module needs_triage plugins plugin (any type) python3 labels Mar 30, 2021
@ansibullbot
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.9 bug This issue/PR relates to a bug module module needs_triage plugins plugin (any type) python3
Projects
None yet
Development

No branches or pull requests

2 participants