So I have a template that runs a PB like"
---
- name: Get data on flex-fiber 9500
  hosts: flex-copper
  gather_facts: no
  

  tasks:

  - name: run show configuration on flex-copper FS 5800
    # cisco.ios.ios_command:
    #   commands: show interface
    ansible.netcommon.cli_command:
      command: show version | json
    register: myconfigs

- name: Show data on flex-copper FS 5800
  hosts: nfs
  gather_facts: no
 

  tasks:

  - name: display value of "myconfigs" variable
    debug:   
      msg: "{{ hostvars['flex-copper'].myconfigs }}"

  - name: copy JSON
    copy:
      content: "{{ hostvars['flex-copper'].myconfigs | to_json(indent=4, 
sort_keys=True )}}"
      dest: "/nfs/html/switch_json/flex-copper-5800_data.json"
      owner: rtlogic
      group: rtlogic
      mode: '0644'

I tried with Cisco with the same error and I always fail with 

 "msg": "failed to elevate privilege to enable mode, still at level [4] and 
prompt [b'\\nflex-c-tor-1# ']",

i have changed my creds for this many times really need some help here

Thanks

B

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/be7db7a1-3f67-4fd8-ad9d-3d7b43e70bd4n%40googlegroups.com.

Reply via email to