【发布时间】:2015-07-14 10:29:27
【问题描述】:
我正在尝试使用 Ansible 安装以下 Jenkins 插件(在安装 Jenkins 时)
git,git-client,ssh,scm-api,shiningpanda 插件
执行包ssh, scm-api, shiningpanda plugins 安装后。git and git-client 不在已安装插件列表中。
以下是我使用的代码和代码链接:
- name: Get the jenkins-cli jarfile from the Jenkins server
get_url:
url: "http://{{host-name}}:8080/jnlpJars/jenkins-cli.jar"
dest: "/opt/jenkins-cli.jar"
register: jarfile_get
until: "'OK' in jarfile_get.msg or 'file already exists' in jarfile_get.msg"
retries: 5
delay: 10
- name: Install Jenkins plugins
command: >
java -jar /opt/jenkins-cli.jar -s http://{{host-name}}:8080/ install-plugin {{ item }}
creates=/var/lib/jenkins/plugins/{{ item }}.jpi
with_items: jenkins_plugins
notify: restart jenkins
- name: Force a change of owner for all plugins
shell: chown -R konfilarity:konfilarity /var/lib/jenkins/plugins/*
notify: restart jenkins
链接到引用的 ansible 脚本:Install-jenkins-plugin-ansible
【问题讨论】:
-
你能发布 Ansible 执行的输出吗?是否显示任何错误?
-
当我在 ip:192.168.33.14 的 vagrant 机器上运行时,它给出了以下输出: TASK: [build_server_jenkins |安装 Jenkins 插件] ************************ 跳过:[192.168.33.14] => (item=credentials) 跳过:[192.168.33.14] = > (item=ssh-credentials) 更改:[192.168.33.14] => (item=git-client) 更改:[192.168.33.14] => (item=git) 更改:[192.168.33.14] => (item= ssh) 跳过:[192.168.33.14] => (item=scm-api) 更改:[192.168.33.14] => (item=shiningpanda) 更改:[192.168.33.14] => (item=test-results-analyzer)
标签: git jenkins-plugins ansible