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

ios_config: ansible 2.5.2 idempotency issue/bug? #40064

Closed
sk1988 opened this issue May 14, 2018 · 4 comments
Closed

ios_config: ansible 2.5.2 idempotency issue/bug? #40064

sk1988 opened this issue May 14, 2018 · 4 comments
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. cisco Cisco technologies ios Cisco IOS community module This issue/PR relates to a module. networking Network category support:network This issue/PR relates to code supported by the Ansible Network Team.

Comments

@sk1988
Copy link

sk1988 commented May 14, 2018

ISSUE TYPE
  • Bug Report
COMPONENT NAME

ios_config

ANSIBLE VERSION
ansible 2.5.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 = /usr/bin/ansible
  python version = 2.7.5 (default, Aug 18 2016, 15:58:25) [GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]
CONFIGURATION

DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 10
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = [u'/etc/ansible/inventory']
DEFAULT_ROLES_PATH(/etc/ansible/ansible.cfg) = [u'/etc/ansible/roles']
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False
PARAMIKO_HOST_KEY_AUTO_ADD(/etc/ansible/ansible.cfg) = True
PERSISTENT_CONNECT_TIMEOUT(/etc/ansible/ansible.cfg) = 30

OS / ENVIRONMENT

Running Ansible from Centos 7.2 and testing ios_config module on a Cisco IOS device running version:

15.2(2)E3

SUMMARY

I am testing Ansible version 2.5.2 to push snmp changes to a Cisco IOS network device. I am only doing a simple command "snmp-server community Test1ng RW" and running the playbook. Despite Ansible pushing the change successfully and the device having it in running-config, Ansible still tries to change configuration again. When doing changes with large configuration files, this is causing a confusion as I don't really know if something got changed in my ansible configuration.

I don't see this issue in Ansible version 2.4.2.0.

STEPS TO REPRODUCE
My playbook configuration is as simple as below:

      - name: DEPLOY SNMP COMMANDS WITHIN PB
        delegate_to: localhost
        ios_config:
           provider: "{{ provider }}"
           commands:
             - snmp-server community Test1ng RW
EXPECTED RESULTS

Ansible should make the change only for the first time and should not change end device anymore.

ACTUAL RESULTS
[root@vm08 ansible]# ansible-playbook cisco-test-1.yml --limit c205wz01

PLAY [Checking running cisco config] *********************************************************************************************************************************************************************************************************

TASK [configure provider] ********************************************************************************************************************************************************************************************************************
ok: [c205wz01]

TASK [DEPLOY SNMP COMMANDS WITHIN PB] ********************************************************************************************************************************************************************************************************
changed: [c205wz01 -> localhost]

PLAY RECAP ***********************************************************************************************************************************************************************************************************************************
c205wz01               : ok=2    **changed=1**    unreachable=0    failed=0

[root@vm08 ansible]#

If I run the playbook again (the playbook output is showing "changed" everytime I run the playbook (even though the end device has the desired configuration). I logged into the device and noticed that Ansible is trying to push the command every single time.

[root@vm08 ansible]# ansible-playbook cisco-test-1.yml --limit c205wz01

PLAY [Checking running cisco config] *********************************************************************************************************************************************************************************************************

TASK [configure provider] ********************************************************************************************************************************************************************************************************************
ok: [c205wz01]

TASK [DEPLOY SNMP COMMANDS WITHIN PB] ********************************************************************************************************************************************************************************************************
changed: [c205wz01 -> localhost]

PLAY RECAP ***********************************************************************************************************************************************************************************************************************************
c205wz01               : ok=2    **changed=1**    unreachable=0    failed=0

[root@vm08 ansible]#

On Network device:

c205wz01#sh run | i Tes
snmp-server community Test1ng RW
c205wz01#
@ansibot
Copy link
Contributor

ansibot commented May 14, 2018

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

@ansibot
Copy link
Contributor

ansibot commented May 14, 2018

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. networking Network category support:network This issue/PR relates to code supported by the Ansible Network Team. labels May 14, 2018
@Akasurde Akasurde removed the needs_triage Needs a first human triage before being processed. label May 14, 2018
@Akasurde Akasurde changed the title ansible 2.5.2 idempotency issue/bug? ios_config: ansible 2.5.2 idempotency issue/bug? May 14, 2018
@akira6592
Copy link
Contributor

It looks like the same cause as #37550 .
and It will be fixed in 2.5.3.

@sk1988
Copy link
Author

sk1988 commented May 22, 2018

Thank you. I have upgraded to Ansible version 2.5.3 and confirm that this issue doesn't appear anymore. I am closing this now.

@sk1988 sk1988 closed this as completed May 22, 2018
@dagwieers dagwieers added ios Cisco IOS community cisco Cisco technologies labels Feb 23, 2019
@ansible ansible locked and limited conversation to collaborators May 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. cisco Cisco technologies ios Cisco IOS community module This issue/PR relates to a module. networking Network category support:network This issue/PR relates to code supported by the Ansible Network Team.
Projects
None yet
Development

No branches or pull requests

5 participants