Rundeck 通过插件与 Ansible 集成 [英] Rundeck integration with Ansible through plugin
问题描述
我无法配置与 ansible 的 rundeck 集成,我正在使用 rundeck-ansible 插件,但我没有从谷歌获得简单有用的信息/帮助.我在同一台服务器上安装了 ansible 和 rundeck.我用过那个插件 https://github.com/Batix/rundeck-ansible-plugin 但无法配置它.任何人都可以分享一步一步指导的链接.任何帮助将不胜感激.
请记住 Ansible 插件与 Rundeck Community 和 Enterprise 一起开箱即用,两种解决方案必须共存于同一服务器/主机中才能正常工作.因此,基本上,您需要执行以下步骤:
1- 配置 Ansible 模型源.为此,单击项目设置",单击编辑节点...".然后点击添加新节点源+"绿色按钮.看看看看.选择Ansible Resource Model Source"和定义您的Ansible清单文件路径(通常在/etc/ansible/hosts
)和 Ansible 配置路径(通常位于 /etc/ansible/ansible.cfg
).在SSH 连接"中您将提供 SSH 用户和身份验证方法来访问您的库存主机(例如,您可以使用";rundeck"用户私钥访问您的库存节点),然后向下滚动并单击保存"按钮.绿色按钮.
现在,如果您单击节点"左侧面板上的链接,您可以看到 Ansible 清单中定义的节点.此外,您可以添加另一个模型源以使用您的剧本.
2- 是时候进行快速测试了,转到左侧面板中的 Commands 选项,在 Nodes 部分,然后选择 Ansible 清单中定义的一些 Ansible 节点并运行一些命令,在示例中,我使用了 ls -a
,看看看看.
3- 现在您可以在您的 ansible 节点上运行任何 command/playbooks/inline-playbooks.>
我留下了一个分配给库存主机的作业定义示例(带有基本的内联脚本剧本):
- defaultTab: 节点描述: ''执行启用:真编号:9cbbdb03-9335-4307-b766-de1f17d81f93日志级别:信息名称:Ansible 内联 Playbook 示例nodeFilterEditable: false节点过滤器:派遣:排除优先级:真继续:假rankOrder:升序successOnEmptyNodeFilter: 假线程数:'1'过滤器:'名称:192.168.33.20'nodesSelectedByDefault: 真插件:ExecutionLifecycle: 空计划启用:真序列:命令:- 配置:ansible-base-dir-path:/etc/ansibleansible-become: '假'ansible-playbook-inline: |----- 主持人:所有用户:流浪任务:- 名称:正常运行时间命令:'正常运行时间'寄存器:输出- 调试:var=output.stdout_linesansible-ssh-passphrase-option: option.passwordansible-ssh-use-agent: '假'节点步骤:真类型:com.batix.rundeck.plugins.AnsiblePlaybookInlineWorkflowNodeStep继续:假策略:节点优先uuid:9cbbdb03-9335-4307-b766-de1f17d81f93
您可以观看此视频以了解有关运行 Ansible 剧本(并使用Rundeck 上的内嵌 Ansible 剧本).
I am not able to configure the rundeck integration with ansible, I am using the rundeck-ansible plugin, but I am not getting easy and useful information/help from google. I have installed ansible and rundeck on the same server. I have used that plugin https://github.com/Batix/rundeck-ansible-plugin but not able to configure it. can anyone please share the link which h guide step by step. Any help will be appreciated.
Keep in mind that the Ansible plugin is out of the box with Rundeck Community and Enterprise, both solutions must coexist in the same server/host to work correctly. So, basically, you need to follow these steps:
1- Configure the Ansible model source. For that click on "Project Settings", click on "Edit Nodes..." and then click on the "Add new Node Source +" green button. Take a look. Choose "Ansible Resource Model Source" and define your Ansible inventory file path (usually at /etc/ansible/hosts
) and Ansible config path (usually at /etc/ansible/ansible.cfg
). In the "SSH connection" section you will provide the SSH user and authentication method to access your inventory hosts (for example, you can use the "rundeck" user private key to access your inventory nodes), then scroll down and click on the "Save" green button.
Now if you click on the "Nodes" link on the left panel, you can see the nodes defined in your Ansible inventory. Also, you can add another model source to use your playbooks.
2- Is time for a quick test, go to the Commands option in the left panel, in the Nodes section then select some Ansible node defined in your Ansible inventory and run some command, in the example, I used ls -a
, take a look.
3- Now you can run any command/playbooks/inline-playbooks over your ansible node.
I leave a job definition example (with a basic inline-script playbook) distpatched to a Inventory host:
- defaultTab: nodes
description: ''
executionEnabled: true
id: 9cbbdb03-9335-4307-b766-de1f17d81f93
loglevel: INFO
name: Ansible Inline Playboook Example
nodeFilterEditable: false
nodefilters:
dispatch:
excludePrecedence: true
keepgoing: false
rankOrder: ascending
successOnEmptyNodeFilter: false
threadcount: '1'
filter: 'name: 192.168.33.20'
nodesSelectedByDefault: true
plugins:
ExecutionLifecycle: null
scheduleEnabled: true
sequence:
commands:
- configuration:
ansible-base-dir-path: /etc/ansible
ansible-become: 'false'
ansible-playbook-inline: |-
---
- hosts: all
user: vagrant
tasks:
- name: uptime
command: 'uptime'
register: output
- debug: var=output.stdout_lines
ansible-ssh-passphrase-option: option.password
ansible-ssh-use-agent: 'false'
nodeStep: true
type: com.batix.rundeck.plugins.AnsiblePlaybookInlineWorkflowNodeStep
keepgoing: false
strategy: node-first
uuid: 9cbbdb03-9335-4307-b766-de1f17d81f93
You can watch this video to learn more about run Ansible playbooks (and use inline Ansible playbooks) on Rundeck.
这篇关于Rundeck 通过插件与 Ansible 集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!