ansible - Ansible - 减少屏幕输出
问题描述
我的剧本中有以下任务,它会在屏幕上生成大量输出。有没有办法隐藏这些行(例如ok: [LAB_RT03] => (item=show runn)
在屏幕上?文件中的项目是在网络设备上运行的显示命令列表。实际上将有 10 条命令。
任务
- name: "retrieve show commands from Routers "
ios_command:
commands:
- command: "{{ item }}"
loop: "{{ lookup('file', './commands/ios_commands.txt').splitlines() }}"
register: ios_output
ignore_errors: true
when: ansible_network_os == 'ios'
输出:
ok: [LAB_RT03] => (item=show runn)
ok: [LAB_RT04] => (item=show runn)
ok: [LAB_RT04] => (item=show version)
ok: [LAB_RT03] => (item=show version)
ok: [LAB_RT04] => (item=show ip route vrf ext)
ok: [LAB_RT03] => (item=show ip route vrf ext)
解决方案
推荐阅读
- python-3.x - 有没有办法使用计数而不是长度来计算排序的查询集?
- typescript - TypeScript argument type inference for a generic function argument with return?
- python - 如何将 Azure 备份报告持续时间列转换为带十进制数字的日期时间
- php - 如何匹配sql中的两个表列
- r - 大型数据集的异常值处理
- python - 创建一个基于 If/Else 的列,其中包含每个条件的字符串值列表
- maven - 如何设置 Maven Archetype 以生成与父项目相同级别的模块项目?
- swift - 将字符串解码并转换为可编码的双精度
- c++ - 使用数据接口将 C++ 数据存储到八度?
- swift - UIAlertController - 等待用户响应