Did you figure this out or get any insight? I have a similar issue running 
a simple nxos_command task.

---
- name: Check CDP State
  nxos_command:
    provider: "{{ prov }}"
    commands:
      - "show cdp global | include globally"
  register: capture_cdp_state

The full traceback is:
Traceback (most recent call last):
  File 
"/usr/lib/python2.7/site-packages/ansible-2.6.1-py2.7.egg/EGG-INFO/scripts/ansible-connection",
 
line 87, in start
    self.connection._connect()
  File 
"/usr/lib/python2.7/site-packages/ansible-2.6.1-py2.7.egg/ansible/plugins/connection/network_cli.py",
 
line 312, in _connect
    self._terminal = terminal_loader.get(network_os, self)
  File 
"/usr/lib/python2.7/site-packages/ansible-2.6.1-py2.7.egg/ansible/plugins/loader.py",
 
line 378, in get
    self._module_cache[path] = self._load_module_source(name, path)
  File 
"/usr/lib/python2.7/site-packages/ansible-2.6.1-py2.7.egg/ansible/plugins/loader.py",
 
line 357, in _load_module_source
    module = imp.load_source(full_name, path, module_file)
  File 
"/usr/lib/python2.7/site-packages/ansible-2.6.1-py2.7.egg/ansible/plugins/terminal/nxos.py",
 
line 30, in <module>
    class TerminalModule(TerminalBase):
  File 
"/usr/lib/python2.7/site-packages/ansible-2.6.1-py2.7.egg/ansible/plugins/terminal/nxos.py",
 
line 33, in TerminalModule
    
re.compile(br'[\r\n]?(?!\s*<)?(\x1b\S+)*[a-zA-Z_0-9]{1}[a-zA-Z0-9-_.]*[>|#](?:\s*)*(\x1b\S+)*$'),
  File "/usr/lib64/python2.7/re.py", line 190, in compile
    return _compile(pattern, flags)
  File "/usr/lib64/python2.7/re.py", line 242, in _compile
    raise error, v # invalid expression
error: nothing to repeat

fatal: [brm07-lab-5k-swi-1.us.oracle.com]: FAILED! => {
    "msg": "nothing to repeat"


On Thursday, July 5, 2018 at 11:39:28 AM UTC-4, Ahmed Aljawad wrote:
>
> [nwadmin@ddcmgtnwbkp ~]$ cat AutoBackup.yml
> ---
> - name: first network playbook with when
>   connection: network_cli
>   gather_facts: false
>   hosts: SFI
>   tasks:
>     - name: backup
>       nxos_config:
>         backup: yes
>       register: backup_nxos_location
>       when: ansible_network_os == 'nxos'
> ...
>
> here is my -vvv
> [nwadmin@ddcmgtnwbkp ~]$ ansible-playbook AutoBackup.yml -u admin -k -vvv
> ansible-playbook 2.5.3
>   config file = /home/nwadmin/ansible.cfg
>   configured module search path = 
> [u'/home/nwadmin/.ansible/plugins/modules', 
> u'/usr/share/ansible/plugins/modules']
>   ansible python module location = /usr/lib/python2.6/site-packages/ansible
>   executable location = /usr/bin/ansible-playbook
>   python version = 2.6.6 (r266:84292, Aug 18 2016, 08:36:59) [GCC 4.4.7 
> 20120313 (Red Hat 4.4.7-17)]
> Using /home/nwadmin/ansible.cfg as config file
> [DEPRECATION WARNING]: [defaults]hostfile option, The key is misleading as 
> it can also be a list of hosts, a directory or a list of paths , use 
> [defaults]
> inventory=/path/to/file|dir instead. This feature will be removed in 
> version 2.8. Deprecation warnings can be disabled by setting
> deprecation_warnings=False in ansible.cfg.
> SSH password:
> Parsed /home/nwadmin/INV_LIST inventory source with ini plugin
>
> PLAYBOOK: AutoBackup.yml 
> ***********************************************************************************************************************************
> 1 plays in AutoBackup.yml
>
> PLAY [first network playbook with when] 
> ********************************************************************************************************************
> META: ran handlers
>
> TASK [backup] 
> **********************************************************************************************************************************************
> task path: /home/nwadmin/AutoBackup.yml:7
> The full traceback is:
> Traceback (most recent call last):
>   File "/usr/bin/ansible-connection", line 87, in start
>     self.connection._connect()
>   File 
> "/usr/lib/python2.6/site-packages/ansible/plugins/connection/network_cli.py", 
> line 306, in _connect
>     self._terminal = terminal_loader.get(network_os, self)
>   File "/usr/lib/python2.6/site-packages/ansible/plugins/loader.py", line 
> 366, in get
>    
>     return _compile(pattern, flags)
>   File "/usr/lib64/python2.6/re.py", line 245, in _compile
>     raise error, v # invalid expression
> error: nothing to repeat
>  self._module_cache[path] = self._load_module_source(name, path)
>   File "/usr/lib/python2.6/site-packages/ansible/plugins/loader.py", line 
> 345, in _load_module_source
>     module = imp.load_source(full_name, path, module_file)
>   File 
> "/usr/lib/python2.6/site-packages/ansible/plugins/terminal/nxos.py", line 
> 30, in <module>
>     class TerminalModule(TerminalBase):
>   File 
> "/usr/lib/python2.6/site-packages/ansible/plugins/terminal/nxos.py", line 
> 33, in TerminalModule
>     
> re.compile(br'[\r\n]?(?!\s*<)?(\x1b\S+)*[a-zA-Z_]{1}[a-zA-Z0-9-_.]*[>|#|%](?:\s*)*(\x1b\S+)*$'),
>   File "/usr/lib64/python2.6/re.py", line 190, in compile
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/8e551a77-af62-4b4b-9e93-19ca8c0b305b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to