Home:ALL Converter>Running ansible playbook from jenkins execute shell

Running ansible playbook from jenkins execute shell

Ask Time:2020-07-28T15:31:20         Author:O_Athens

Json Formatter

I am trying to run an ansible playbook from Execute Shell section of Jenkins,But I am getting below errors.I have already install Ansible plugin and configured in global tool configuration section.

+ ansible-playbook -i inventory installapache.yml -vvvv
/tmp/jenkins1596894985578146945.sh: line 4: ansible-playbook: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE

I am using below commands:

export ANSIBLE_FORCE_COLOR=true
cd /home/ec2-user
ansible-playbook -i hosts /home/ec2-user/installapache.yml -vvvv

Author:O_Athens,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/63129083/running-ansible-playbook-from-jenkins-execute-shell
yy