【问题标题】:Jenkins job execution issue詹金斯作业执行问题
【发布时间】:2020-07-28 05:17:44
【问题描述】:

我正在尝试触发一个抛出错误的 Jenkins 作业。Jenkins 托管在 AWS ec2 实例上

/tmp/jenkins7326195626020563202.sh: line 4: cd: /home/ec2-user: Permission denied

Build step 'Execute shell' marked build as failure

Finished: FAILURE

我的 Jenkins 作业有以下要执行的 shell 命令:

export ANSIBLE_FORCE_COLOR=true

cd /home/ec2-user

ansible-playbook -i hosts /home/ec2-user/installapache.yml -vvvv

请在此处帮助我解决上述错误。

【问题讨论】:

    标签: unix jenkins amazon-ec2 ansible


    【解决方案1】:

    当 jenkins 用户在 /home/ec2-user 中没有权限时,就会出现该问题。

    所以解决这个问题:

    chmod -R 777 /home/ec2-user

    或将 jenkins 用户添加到 ec2-user 组

    或授予 jenkins 用户具有 root 权限。

    【讨论】:

    • 尽管我已经安装了 Ansible 插件并在 Jenkins 中进行了配置,但现在我遇到了以下错误。 /tmp/jenkins3254324334919499300.sh:第 4 行:ansible-playbook:找不到命令
    • 如果您遇到问题,请创建另一个问题
    • 在 Jenkins 服务器中安装 ansible-playbook
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-07
    • 2022-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多