When using jenkins project because the script execution permissions issue fail

fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "sudo:抱歉,您必须拥有一个终端来执行 sudo\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}
 [WARNING]: Could not create retry file '/tmp/ansible-playbook-
sample/site.retry'.         [Errno 13] Permission denied: u'/tmp/ansible-
playbook-sample/site.retry'

解决方法:

Under 1. centos environment, in /etc/sudoers.d/ directory, add a jenkins file, as follows:

Defaults:jenkins !requiretty

jenkins ALL=(ALL) NOPASSWD: ALL

2. Before the command script, you can increase the sudo command, or execute a script sudo

sudo /opt/webmaster/sitedeploy.sh --source $BUILD_DIR --site xxx.com --clear

Guess you like

Origin www.cnblogs.com/love-vce/p/11351725.html