Ansible中VM部署前检查
在过去的几天里,我一直在尝试制作一本剧本,以在Ansible开始创建一个新的Windows VM之前检查一些东西,我是初级工程师,并且只是在Ansible的道路上开始,
我发现了Ping部分,但是我真正的是想知道是否有某种方法可以检查计算机名称是否已经在Active Directory中注册,并且是否应该停止工作流程。
我不确定Win_Domain_computer是否也可以检查。
谢谢
I have been trying for the past days to make a playbook to check for some things before ansible starts creating a new windows VM, I'm a junior engineer and just starting on the path of Ansible
I figured out the ping part but what I really want to know is if there's some way to check if the computer name is already registered in Active Directory and if it is the workflow should stop.
I am not sure if win_domain_computer can also just check.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为PowerShell请求是一种做到这一点的方式。
在我的剧本中,我们没有在Active Directory中检查名称,但我们会检查DNS记录
通过任务,与Get-Adcomputer类似的事情应该可以。
任务DNS示例:
I think a powershell request is a way to do that.
In my playbook, we don't check name in Active Directory, but we check dns record
with a task, something similar with get-adcomputer should be ok.
Task dns example :