【问题标题】:How to find host uptime in vmware from ansible如何从 ansible 找到 vmware 中的主机正常运行时间
【发布时间】:2018-04-09 14:08:04
【问题描述】:

如何从 ansible 找到 vmware 中的机器正常运行时间。

我想在不连接机器的情况下查找主机正常运行时间。

使用ansible

ansible_vm_facts

我可以得到一些细节,比如

操作系统,机器名

但我没有得到正常运行时间。

我遵循了以下文档但没有运气。没有什么对我有用。 http://docs.ansible.com/ansible/latest/modules/vmware_vm_facts_module.html http://docs.ansible.com/ansible/latest/modules/vmware_host_module.html

【问题讨论】:

    标签: command ansible vmware uptime


    【解决方案1】:

    ansible 文档的入门解释了您可以通过调试模块获得哪些信息:

    register: vmvariable
    
    - debug:
          var: vmvariable
    

    但我认为如果不从主机获取事实,您就无法获得正常运行时间价值。

    我认为您可以从事实缓存中获取此 var,但此事实无关紧要。

    【讨论】:

    • @samuel liew - 这行不通。如果我使用它,我不会得到所有的值
    猜你喜欢
    • 1970-01-01
    • 2021-08-26
    • 2014-01-06
    • 1970-01-01
    • 2021-09-12
    • 1970-01-01
    • 2021-01-17
    • 2019-12-19
    • 1970-01-01
    相关资源
    最近更新 更多