我的工作是自动化安装和使用基于角色的策略插件在Jenkins使用ansible。目前,我可以使用API轻松地安装插件。然而,为了使用这个插件,有必要通过Jenkins UI激活它,方法是单击“管理Jenkins,然后配置系统并选择一个基于角色的策略。”由于Jenkins中似乎不存在API,所以我很难实现激活过程的自动化。这是我的相关的ansible代码。
- name: Install a role based plugin if it does not exist
uri:
url: "http://localhost:8080/pluginManager/installNecessaryPlugins"
method: POST
user: admin
password: bd7afbedc842418fb7fc27fdf8b3d2e4
force_basic_auth: yes
body: '<jenkins><install plugin="role-strategy@2.9.0" /></jenkins>'
headers:
Content-Type: "text/xml"
follow_redirects: all
when: "'Role-based Authorization Strategy' not in plugins_output_list.content"
ignore_errors: yes安装插件后,我是否可以不使用UI来激活它?为此,我真的看不到任何API。
发布于 2019-08-06 22:46:19
https://stackoverflow.com/questions/54595865
复制相似问题