ansible-playbook check_smt.yml
- name: 检查超线程状态
hosts:
- your_hosts01
- your_hosts02
gather_facts: false
tasks:
- name: 执行命令
command: cat /sys/devices/system/cpu/smt/active
register: command_output
- name: 打印命令输出
debug:
var: command_output.stdout_lines
when: command_output.stdout != "0"