ansible-playbook 检查超线程状态

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

猜你喜欢

转载自blog.csdn.net/u010953692/article/details/132496358