sros network modules in ansible 2.7.0

146 views
Skip to first unread message

DC

unread,
Oct 12, 2018, 12:26:04 PM10/12/18
to Ansible Project
Ansible newbie here.  I'm trying to learn about network_cli so installed a recent version of ansible
 ansible --version
ansible 2.7.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/ubuntu/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.15rc1 (default, Apr 15 2018, 21:51:34) [GCC 7.3.0]

It appears the first task/commands executes ok, but as soon as I add a second task in the playbook (even a debug task) I end up with the error:
TASK [sros_command] ****************************************************************************************
task path: /tmp/sros.yml:7
The full traceback is:
Traceback (most recent call last):
  File "/usr/bin/ansible-connection", line 290, in main
    messages.extend(conn.update_play_context(pc_data))
  File "/usr/lib/python2.7/dist-packages/ansible/module_utils/connection.py", line 173, in __rpc__
    raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)
ConnectionError: 'Connection' object has no attribute 'reset_history'

fatal: [sr]: FAILED! => {
    "msg": "'Connection' object has no attribute 'reset_history'"
}

Even trying to revert back to using 'provider' and 'connection: local' fails with a similar error.

Thanks,
DC

joba...@redhat.com

unread,
Oct 19, 2018, 9:26:19 AM10/19/18
to Ansible Project
Hi,
Could you please raise a bug at https://github.com/ansible/ansible/issues/new/choose and include the two tasks (and any group_vars/inventory, etc)

Kind regards,
gundalow
Message has been deleted

Mike Dodd

unread,
Jan 11, 2019, 7:31:40 PM1/11/19
to Ansible Project
Here is a perfect example of the bug, also using Ansible 2.7.0:


- name: TWO TASKS BREAKS SROS
  hosts: sros
  connection: local
  gather_facts: no

  vars_files:
  - group_vars/all

  tasks:

  - name: Get Router system name
    sros_command:
      provider: "{{ router_auth }}"
      commands: show system information | match "System Name"
    register: system_name

  - debug:
      var: system_name


  - name: Configure VPLS service
    sros_config:
      provider: "{{ router_auth }}"
      parents:
        - configure service
        - vpls "{{ internet_vpls_id }}" customer 1 create
        - allow-ip-int-bind
      lines: exit
    register: vpls

  - debug:
      var: vpls


-------
-Failure:

The full traceback is:

Traceback (most recent call last):

  File "/usr/local/bin/ansible-connection", line 290, in main

    messages.extend(conn.update_play_context(pc_data))

  File "/usr/local/lib/python2.7/site-packages/ansible/module_utils/connection.py", line 173, in __rpc__

    raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)

ConnectionError: 'Connection' object has no attribute 'reset_history'


fatal: [infr-rt002-d06.nae02.use1.viasat.cloud]: FAILED! => {

Ganesh Nalawade

unread,
Jan 12, 2019, 3:20:26 AM1/12/19
to Ansible Project

The issue is fixed by PR #49174 and the fix is available in Ansible version 2.7.5 
Please retest with 2.7.5 version and check if the issue is still seen.

Regards,
Ganesh

Stan Kozlov

unread,
Mar 22, 2019, 9:32:47 AM3/22/19
to Ansible Project
I has similar issue with 7750 TiMOS-C-14.0.R5 and Ansible 2.7.0 
Upgrade up to 2.7.5 has fixed the issue

Cheers 
Reply all
Reply to author
Forward
0 new messages