问题描述
我的问题是,当从Rundeck运行一个Ansible剧本时,我该在哪里设置要定向的主机?在Rundeck的工作/工作流程中还是在有趣的剧本中?
My question is when running a ansible playbook from Rundeck where do i set what hosts get targeted?In the Rundeck job/ workflow or ansible playbook?
推荐答案
要使用Ansible广告资源,您需要添加一个新的Ansible节点源.看看此.特别是步骤3.
To use Ansible inventory you need to add a new Ansible node source. Take a look at this. Especially the step 3.
在Rundeck中添加Ansible节点源,您可以在Rundeck节点列表中看到Ansible清单(通常在/etc/ansible/hosts
).因此,您可以同时使用两个节点源(之前定义的Ansible库存和Rundeck库存:resources.xml
文件或resources.yml
)
Adding the Ansible node source in Rundeck you can see the Ansible inventory (usually at /etc/ansible/hosts
) in your Rundeck node list. So, you can use both node sources (Ansible inventory defined before and Rundeck inventory: maybe resources.xml
file or resources.yml
),
这意味着您可以使用Rundeck作业定义中的分配给节点",将您的剧本和命令步骤/脚本指向Ansible/Rundeck节点,而不会出现问题.
That means that you can point your playbooks and command steps/scripts to Ansible/Rundeck nodes without problems using "dispatch to nodes" in Rundeck job definition.
这篇关于在Rundeck或Ansible中,您将主机定位到何处?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!