【发布时间】:2016-08-15 20:30:15
【问题描述】:
我正在使用 Ansible / Ansible Tower,并想确定我的 Windows 主机上可用的事实。 documentation 声明我可以运行以下命令:
ansible hostname -m setup
如何将其合并到从 Tower 运行的剧本中,以便从主机收集信息?
根据所提供的帮助,这是当前的剧本:
# This play outputs the facts of the Windows targets in scope
- name: Gather Windows Facts
hosts: "{{ target }}"
gather_facts: yes
tasks:
- setup:
register: ansible_facts
- debug: item
with_dict: ansible_facts
但是,运行它会产生以下错误:
错误!此任务“调试”具有额外的参数,仅允许在 以下模块:命令、shell、脚本、包含、include_vars、 add_host, group_by, set_fact, raw, meta
【问题讨论】:
标签: ansible ansible-playbook ansible-facts