Re: [ansible-project] Re: How do I use multiple ansible versions on the same machine for different playbooks that require specific versions?

2016-08-01 Thread Mike Biancaniello
I would also suggest python virtual environments. 

Although, I have also used Docker images for running Ansible. I create a 
Docker image with 'ansible' as the ENTRYPOINT, then create a shell script 
to execute 'docker run -it --rm   []'. This will execute ansible inside the docker and use the 
playbooks that you put inside the image when you created it.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ff2d5f86-7bd8-4773-91b8-e94e711d1220%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: How do I use multiple ansible versions on the same machine for different playbooks that require specific versions?

2016-07-31 Thread Carlos A. Carnero Delgado
2016-07-28 19:57 GMT-04:00 Subramanian P V :

> I am facing the same situation. Is there a way to run ansible like an
> excutable like sourcing in old environments. I have a setup where ansible
> 1.5 is present and on the same machine i need to  execute the ansible
> scripts of 2.0.0.2 version
>

IMO, the best option in this case is to make use of Python virtual
environments, and install Ansible via pip
.
You can have several virtual environments, each with different Ansible
versions, and then activate the one you need prior to running your
playbooks.

HTH,
Carlos.

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAPjvz2mb_R%2BJRof1mCS%2BYnn9QpJ4yMe3yF%3D9jyLUj_9HuzE1%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How do I use multiple ansible versions on the same machine for different playbooks that require specific versions?

2016-07-31 Thread Subramanian P V
Hi Philip,

I am facing the same situation. Is there a way to run ansible like an 
excutable like sourcing in old environments. I have a setup where ansible 
1.5 is present and on the same machine i need to  execute the ansible 
scripts of 2.0.0.2 version

Thanks

Regards
Subramanian
On Wednesday, February 10, 2016 at 6:27:45 AM UTC-8, Philip Kirkland wrote:
>
> 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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fac64154-0dcf-4765-994a-b37a53c242c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How do I use multiple ansible versions on the same machine for different playbooks that require specific versions?

2016-02-11 Thread ProfHase
I would propose you to use python's virtualenvs:

virtualenv ansible17
source ansible17/bin/activate
pip install ansible==1.7
# work with it
deactivate
# next time
source ansible17/bin/activate


It is the same approach as you are using, but as virtualenv encapsulates 
the whole environment, so you don't need to bother about the dependencies

Am Mittwoch, 10. Februar 2016 15:27:45 UTC+1 schrieb Philip Kirkland:
>
> 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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a5cf5de3-4089-44a0-a1b4-8be281c60474%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How do I use multiple ansible versions on the same machine for different playbooks that require specific versions?

2016-02-11 Thread ProfHase
I would propose you to use python's virtualenvs:

virtualenv ansible17
source ansible17/bin/activate
pip install ansible==1.7
# work with it
deactivate
# next time
source ansible17/bin/activate


It is the same approach as you are using, but as virtualenv encapsulates 
the whole environment, so you don't need to bother about the dependencies

Am Mittwoch, 10. Februar 2016 15:27:45 UTC+1 schrieb Philip Kirkland:
>
> 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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5f1fc31d-5906-453c-8d67-bf7ee58b12ac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.