我想na_ontap_command
使用 ansible-playbooks 打印模块生成的存储文件管理器版本输出。
我试图在一个变量中注册结果并使用调试消息打印它,但我收到了错误。
`---
- hosts: localhost
name: run ontap cli command
gather_facts: no
connection: local
vars_files:
- var_file.yml
tasks:
- name: run ontap cli command
na_ontap_command:
command: ['version']
https: true
validate_certs: false
hostname: "{{ hostname }}"
username: "{{ username }}"
password: "{{ password }}"
register: command_result
- debug:
var: command_result.stdout_lines
`
我的剧本应该返回存储文件管理器的版本NetApp Release 9.1P8
这是我得到的调试:
>TASK [debug] *********************************************************************************************************************************************************************************************************** ok: [localhost] => { "command_result.stdout_lines": "VARIABLE IS NOT DEFINED!" }