I think there is a typo in the "run_device_commands.yml" file. - hosts: all gather_facts: false collections: - zpe.device_connection vars_prompt: - name: target prompt: Enter target name, either ttyS or current device name - name: username prompt: Enter username - name: password prompt: Enter target password - name: **_`target (It should be target_os)`_** prompt: Enter target_os [generic, ios, junos,panos,fortios] default: generic tasks: - name: Run commands run_command: target: "{{ target }}" username: "{{ username }}" password: "{{ password }}" target_os: "{{ target_os }}" cmds: - 'show version' register: cmds_output - name: Print command results debug: var: cmds_output
I think there is a typo in the "run_device_commands.yml" file.
hosts: all
gather_facts: false
collections:
vars_prompt:
prompt: Enter target name, either ttyS or current device name
prompt: Enter username
prompt: Enter target password
target (It should be target_os)prompt: Enter target_os [generic, ios, junos,panos,fortios]
default: generic
tasks:
name: Run commands
run_command:
target: "{{ target }}"
username: "{{ username }}"
password: "{{ password }}"
target_os: "{{ target_os }}"
cmds:
- 'show version'
register: cmds_output
name: Print command results
debug:
var: cmds_output