【发布时间】:2019-10-22 10:05:18
【问题描述】:
我开始尝试 Ansible,并使用 Ansible 文档中的示例代码。在我尝试了几个示例之后,我在代码的开头得到了错误。它说
- name: Change the hostname to Windows_Ansible
^ here(Point at name)"
任何建议将不胜感激。
我试过这个 https://docs.ansible.com/ansible/latest/modules/win_hostname_module.html#win-hostname-module
---
- name: Change the hostname to Windows_Ansible
win_hostname:
name: "Windows_Ansible"
register: res
- name: Reboot
win_reboot:
when: res.reboot_required
【问题讨论】:
-
您的剧本无效。它只包含任务。这些任务应该包含在戏剧中。看看playbook basics in the documentation