Support for virtualenvs in Ansible plugin

131 views
Skip to first unread message

Kenneth Koski

unread,
Sep 9, 2016, 12:10:14 PM9/9/16
to Jenkins Users
This might be a feature request, if so pointers on how to request it would be helpful. I'd like to run an Ansible playbook from within Jenkins pipeline. It looks like the ansiblePlaybook plugin allows an installation parameter to be passed, but this must be set up globally. Is there any way to point it at a virtualenv without configuring the virtualenv globally? Basically, I'd like to do something like this:

stage 'Create virtualenv'
  sh
'virtualenv venv'
  sh
'venv/bin/pip install -r requirements.txt'


stage
'Run Ansible deploy'
  ansiblePlaybook
(playbook: 'foo.yml', ansibleExecutable: 'venv/bin/ansible-playbook')


Reply all
Reply to author
Forward
0 new messages