面临使用ansible脚本通过jenkins管道从afrtifactory下载aftrifacts的问题

时间:2017-07-24 12:25:27

标签: jenkins ansible jenkins-pipeline artifactory

尝试在Jenkins管道中执行ansible脚本时获取权限被拒绝错误

Jenkins error

下面是我的Jenkins管道脚本

node {
    ansiblePlaybook colorized: true, extras: '-e ear_url="ARTIFACTORY URL here"', installation: 'ansible-2.7', playbook: '/etc/ansible/playbooks/deploy.yml', sudo: true
}

可疑脚本

hosts: tibco
  user: root
  sudo: yes
  connection: ssh
  gather_facts: no
  vars:
   my_ear: "{{ear_url}}"
   ear_location: /tmp/EARS  
  tasks:
    - name: Download the ear file from the artifactory
      get_url: 
        url: "{{my_ear}}" 
        dest: "{{ear_location}}"

请帮帮我。

1 个答案:

答案 0 :(得分:0)

确保所使用的用户对上述文件夹" / etc / ansible / playbooks"

具有写入权限