ansible.netcommon icon indicating copy to clipboard operation
ansible.netcommon copied to clipboard

Module netconf_config not making changes when using `target: candidate`

Open harrytruman opened this issue 4 years ago • 0 comments

SUMMARY

When using the netconf_config module to push a device configuration, Ansible does not make a change when we attempt to use the candidate datastore.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

netconf_config

ANSIBLE VERSION
config file = /home/ec2-user/git/ansible/ansible.cfg
  configured module search path = ['/home/ec2-user/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/ec2-user/git/venv/ansible/lib64/python3.7/site-packages/ansible
  executable location = /home/ec2-user/git/venv/ansible/bin/ansible-playbook
  python version = 3.7.6 (default, Feb 26 2020, 20:54:15) [GCC 7.3.1 20180712 (Red Hat 7.3.1-6)]
CONFIGURATION
DEFAULT_CALLBACK_WHITELIST(/home/ec2-user/git/ansible/ansible.cfg) = ['timer', 'profile_tasks', 'profile_roles']
DEFAULT_DEBUG(env: ANSIBLE_DEBUG) = True
DEFAULT_LOG_PATH(env: ANSIBLE_LOG_PATH) = /home/ec2-user/ansible-debug.log
DEFAULT_STRATEGY(/home/ec2-user/git/ansible/ansible.cfg) = free
OS / ENVIRONMENT

RHEL 8.1, Tower 3.7.1 Cisco IOS-XE 16.12.2-r

STEPS TO REPRODUCE

When using target: candidate, Ansible seems to place the file on the device datastore, but fails to commit the change. When making the same change directly to the netconf console and using the candidate datastore, the change is completed as expected.

- name: Configure interfaces via NETCONF OpenConfig YANG Model
  when: yang_model == 'oc'
  netconf_config:
    content: "{{ lookup('template', './oc_intf_l2.j2') }}"
    target: candidate
    timeout: 300
    commit: yes
    validate: no
EXPECTED RESULTS

We should see the device being changed.

ACTUAL RESULTS

No change is made on the device, yet the expected/changed output is displayed and Ansible reports a change has occurred.

ok=3    changed=1

harrytruman avatar Jul 31 '20 19:07 harrytruman