Ansible Tower我们可以将主机名作为变量传递给作业模板

问题描述 投票:0回答:1

对于Ansible Tower,我们可以将主机名作为变量传递给作业模板,以便在作业模板运行时,我们可以在运行时动态传递主机详细信息,并且剧本将在此主机上运行。从根本上讲,此变量然后应更新清单文件

ansible ansible-inventory ansible-tower
1个回答
0
投票

嗯,是和不是。您可以在播放中为hosts设置一个变量,然后在Tower中设置该变量。所以您的剧本看起来像这样:

---
- hosts: "{{ my_host_variable }}"
  tasks:
    .
    .
    .

并通过模板传递my_host_variable

© www.soinside.com 2019 - 2024. All rights reserved.