如何在ansible playbook中比较来自多个主机的事实

如何在ansible playbook中比较来自多个主机的事实,ansible,Ansible,如何创建一个剧本来比较Ansible中多个主机的事实?我希望能够比较主机与其他主机,以发现一个关闭。我所有的工作站都应该完全一样 - name: Gather Facts hosts: all - debug: var=vars - debug: vars=hostvars[inventory_hostname] - debug: msg: "{{ hostvars[inventory_hostname] | difference([inventory_ho

如何创建一个剧本来比较Ansible中多个主机的事实?我希望能够比较主机与其他主机,以发现一个关闭。我所有的工作站都应该完全一样

- name: Gather Facts
  hosts: all
  - debug: var=vars
  - debug: vars=hostvars[inventory_hostname]
  - debug:
      msg: "{{ hostvars[inventory_hostname] | difference([inventory_hostname]) }}""

是否要比较所有主机之间的所有事实?是。我想找出主机之间的差异。是否要比较所有主机之间的所有事实?是。我想找出主持人之间的区别。