---
- 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