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

Expand any multi-line commands #43964

Open
wants to merge 2 commits into
base: devel
from

Conversation

Projects
None yet
4 participants
@yaplej
Contributor

yaplej commented Aug 10, 2018

Loop through all the lines in module.params['lines'] and expand any multi-line commands into their own lines so they can be checked via difference().

SUMMARY

When ios_config has multiple commands on a single line it cannot correctly difference against the running config so the module detects a change and runs when nothing has actually changed.

Fixes #43842

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
ANSIBLE VERSION
ansible 2.6.2
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /bin/ansible
  python version = 2.7.5 (default, Aug  4 2017, 00:39:18) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)]
ADDITIONAL INFORMATION

Expand any multi-line commands
Loop through all the lines in module.params['lines'] and expand any multi-line commands into their own lines so they can be checked via difference().
@ansibot

This comment has been minimized.

Contributor

ansibot commented Aug 10, 2018

@ansibot

This comment has been minimized.

Contributor

ansibot commented Aug 10, 2018

Hi @yaplej,

Thank you for the pullrequest, 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

@ganeshrn

This can be done in the playbook

  - set_fact:
      config_text: "{{ lookup('file', 'ios.cfg').split('\n') }}"

imo it shouldn't be handled in code

@ansibot

This comment has been minimized.

Contributor

ansibot commented Sep 7, 2018

@yaplej this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

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