Hello, I need your help When I execute my ansible command directly "ansible-playbook playbook.yml -i hosts" without going through jenkins I have no problem
ubuntu@ip-172-31-40-178:/var/lib/jenkins/workspace/SI-AFD$ ansible-playbook playbook.yml -i hosts PLAY [[LOCAL DEPLOYMENT]] ********************************************************************************************************************************************************************** TASK [Clean tmp directory] ********************************************************************************************************************************************************************* [WARNING]: Consider using 'become', 'become_method', and 'become_user' rather than running sudo changed: [127.0.0.1 -> localhost] TASK [Get updated files from AFD git repository] *********************************************************************************************************************************************** changed: [127.0.0.1] but when I go through jenkins I have this error: [Pipeline] }[Pipeline] // stage[Pipeline] stage <http://52.47.207.167/job/SI-AFD/13/console#>[Pipeline] { (Deploiement Ansible) <http://52.47.207.167/job/SI-AFD/13/console#>[Pipeline] sh <http://52.47.207.167/job/SI-AFD/13/console#>+ ansible-playbook playbook.yml -i hosts PLAY [[LOCAL DEPLOYMENT]] ****************************************************** TASK [Clean tmp directory] ***************************************************** fatal: [127.0.0.1 -> localhost]: FAILED! => {"changed": false, "module_stderr": "sudo: a password is required\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1} PLAY RECAP ********************************************************************* 127.0.0.1 : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0 -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7c4b57bf-738a-4fe0-a667-9c958e5ed4ca%40googlegroups.com.
