Hi,

You can basically do what the env-setup script is doing with that in bash for 
example:

ANSIBLE=path-to-my-ansible-version
export PATH=$PATH:$ANSIBLE/bin
export PYTHONPATH=$ANSIBLE/lib
export ANSIBLE_LIBRARY=$ANSIBLE/library

You just need to manipulate those variables, so that should not be too bad to 
script.

Ghislain

From: [email protected] 
[mailto:[email protected]] On Behalf Of Philip Kirkland
Sent: February-10-16 2:16 AM
To: Ansible Project
Subject: [ansible-project] How do I use multiple ansible versions on the same 
machine for different playbooks that require specific versions?

Hi all,

Perhaps I'm approaching this the wrong way; I would appreciate some feedback.

We have various playbooks that have been developed over a period of time. Due 
to the (sometimes) lack of backwards compatibility of ansible, some playbooks 
might require a specific version. I don't want to run this on different ansible 
runtime/orchestration servers; I'd like to be able to handle this on the one 
server.

In previous versions (prior to the core/extras submodule being split out), we 
could typically download some tar.gz releases and unzip/extract them into 
different directories. Then prior to running a playbook we could source 
hacking/env-setup for the specific version that we needed and could run the 
playbook.

For example:
source ansible-1.7.2/hacking/env-setup
# run my ansible-playbook that requires version 1.7.2

source ansible-1.6.3/hacking/env-setup
#run my ansible-playbook that requires version 1.6.3

The above does not work since the core and extras modules became git submodules 
as outlined below.

Now I have a couple of options:

1. Take a release (such as 
http://releases.ansible.com/ansible/ansible-2.0.0.2.tar.gz). This doesn't have 
the hacking directory so how do I configure my environment? I don't want to run 
setup since doing this for different versions will override each other, and 
running jobs in parallel would certainly get issues if I did this. Hence I 
don't have an easy mechanism of catering for different versions.

2. Take a source tar.gz (such as 
https://github.com/ansible/ansible/archive/v2.0.0.2-1.tar.gz). Whilst this 
gives me the hacking directory the lib/ansible/modules/core and 
lib/ansible/modules/extras (which correspond to the git submodules) are empty, 
so I would need to obtain those as well. How do I get those?

What I think would solve my issue is a tarball that includes all the source 
(including the git submodules) as well as the hacking directory.

Or am I going about this the wrong way?

Thanks for any help, advice or pointers.

Phil

--
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]<mailto:[email protected]>.
To post to this group, send email to 
[email protected]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b0308811-de7f-45de-95a3-4d1d2241332e%40googlegroups.com<https://groups.google.com/d/msgid/ansible-project/b0308811-de7f-45de-95a3-4d1d2241332e%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/815e9530ec24493b955ebd256230e305%40DG3MBX01-DOR.bell.corp.bce.ca.
For more options, visit https://groups.google.com/d/optout.

Reply via email to