Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2016-04-05 Thread Jonathan Davila
You can set the python interpreter as a host or group var. Normally I set ansible_python_interpreter: /usr/bin/env python But in your case it sounds like you'd want a specific path. On Friday, April 1, 2016 at 7:18:17 PM UTC-4, Osama Shaikh wrote: > > Hi Brian, > > Has there been any update on

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2016-04-01 Thread Osama Shaikh
Hi Brian, Has there been any update on setting ansible_python_interpreter in ansible.cfg. Our use case is Inside a system user account, we have our own python 2.7.6 version and we want to use ansible_python_interpreter to set our own python path not the one comes by default. Regards, Osa

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2015-04-23 Thread Brian Coca
its still on my 'todo' list, cannot show examples until it transitions to my 'done' list -- Brian Coca -- 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 ansi

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2015-04-23 Thread Vu Do
Hi Brian Coca Set PATH variable like this in play level work well for me, environment: PATH: "{{ ansible_env.PATH }}:/usr/local/bin" I just wonder how you set this in global or inventory setting? Can you show me an example of inventory setting? On Friday, April 17, 2015 at 9:59:06 PM UTC

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2015-04-17 Thread Brian Coca
yes, environment is now settable at task/play level, I have it on my list to add either a global (ansible.cfg) or inventory setting -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop recei

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2015-04-17 Thread Eugene Sajine
yes, i have misstated the problem in my initial question a bit, sorry. I know about the ansible_python_interpreter and it does take care of the simplejson error, as instead of using the interpreter that is available in PATH it uses what i have specified. So the only question about that variable r

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2015-04-17 Thread Brian Coca
ansible_env.PATH is a reflection of the PATH variable on the system when ansible gathered facts, ansible does not set the path in a special maner. The PATH is set by the host as it would for any other non login process (not sourcing .bashrc or other shell equivalents). If you are having issues usi

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2015-04-17 Thread Steven Haddox
It's been my experience that ansible absolutely requires Python 2.6+ or Python 2.4 with the simplejson module. I don't know where in the documents, but I reference this in my README for my main ansible project: https://github.com/stevenhaddox/ansible_rails_enterprise/blob/master/README.md I also

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2015-04-16 Thread Eugene Sajine
I'm having problems with some hosts running ansible: It complains that there is no simplejson module found. I figured that it is something to do with the way ansible_env.PATH is set as somehow it picks up a very old version of python and i can't figure out where it comes from. I posted the ques

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2015-04-13 Thread Brian Coca
you have the environment: keyword that can set path per task, in 1.9 you can do it per play. -- Brian Coca -- 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 t

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2015-04-13 Thread David Vallee Delisle
So that seems to fix the issue but it's a very ugly fix. There should be a way to set the sudo_exe variable per server in the inventory file... On Sunday, December 14, 2014 at 1:16:16 PM UTC-5, Sagar Srivastava wrote: > > I know this is an old post but if someone still sees my reply, may tell me

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2014-12-14 Thread Sagar Srivastava
I know this is an old post but if someone still sees my reply, may tell me how bad is it to do the following ( create a symbolic link in /usr/bin for sudo - it works in my solaris box): ln -s /usr/local/bin/sudo /usr/bin/sudo On Thursday, November 21, 2013 3:15:09 PM UTC-5, Brian Coca wrote:

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-26 Thread Paul Markham
On Tuesday, November 26, 2013 9:44:37 AM UTC+11, Melissa Tan wrote: > > > After it is set, I'm faced with a password prompt when no password > required is already done. So it is actually executing sudo, but sudo isn't > setup to authorized the command that Ansible is pushing through. The > s

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-25 Thread Melissa Tan
This might somewhat help you Stephen as you're using zsh, but I'm just posting this for the benefit of anyone else using bash. It appears that login/non-interactive zsh shells uses .zlogin or maybe .zshenv for startup. *Problem Statement:* I need to use gnu tar which is installed in /usr/local

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-25 Thread Melissa Tan
On Sunday, 24 November 2013 07:01:06 UTC-8, Steven Haddox wrote: > > Melissa, > > I have this same situation and ansible's default setup of not using a > user's login shell caught me off-guard at first to. It makes sense though > for Ansible **not** to want to load the user's environment in ord

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-24 Thread Steven Haddox
Melissa, I have this same situation and ansible's default setup of not using a user's login shell caught me off-guard at first to. It makes sense though for Ansible **not** to want to load the user's environment in order to ensure a consistent shell experience for all modules (especially if a u

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-23 Thread Melissa Tan
On Saturday, 23 November 2013 07:41:09 UTC-8, Michael DeHaan wrote: > > As indicated, this isn't about setting the path, this is about configuring > sudo in ansible.cfg to include the full path to the sudo executable. > > This is the way this will need to be done as this all happens before > ex

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-23 Thread Michael DeHaan
As indicated, this isn't about setting the path, this is about configuring sudo in ansible.cfg to include the full path to the sudo executable. This is the way this will need to be done as this all happens before executing the module, hence using Ansible to set a path is not possible. On Fri,

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-22 Thread Melissa Tan
On Friday, 22 November 2013 12:57:48 UTC-8, Michael DeHaan wrote: > > "But target hosts are Solaris 10 on x86 with Python 2.6" > > Sounds like that's it, you just didn't have sudo in path. > > Yes, but the problem is that I can't set the PATH to what I need it to /usr/local/bin/sudo . I had it se

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-22 Thread Michael DeHaan
"But target hosts are Solaris 10 on x86 with Python 2.6" Sounds like that's it, you just didn't have sudo in path. On Fri, Nov 22, 2013 at 1:58 PM, Melissa Tan wrote: > > > On Thursday, 21 November 2013 23:19:48 UTC-8, Michael DeHaan wrote: >> >> What OS are you running from? >> >> RHEL 6 Sa

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-22 Thread Melissa Tan
On Thursday, 21 November 2013 23:19:48 UTC-8, Michael DeHaan wrote: > > What OS are you running from? > > RHEL 6 Santiago Linux bchopsadmp 2.6.32-279.el6.x86_64 #1 SMP Wed Jun 13 18:24:36 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux But target hosts are Solaris 10 on x86 with Python 2.6 -- You re

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-21 Thread Michael DeHaan
What OS are you running from? -- Michael On Nov 21, 2013, at 10:53 PM, Melissa Tan wrote: On Thursday, 21 November 2013 17:02:55 UTC-8, Michael DeHaan wrote: > > "Instead of breaking right away, I ended up leaving for tea and found out > it's hanging because it's expecting inputs." > > --ask-s

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-21 Thread Melissa Tan
On Thursday, 21 November 2013 17:02:55 UTC-8, Michael DeHaan wrote: > > "Instead of breaking right away, I ended up leaving for tea and found out > it's hanging because it's expecting inputs." > > --ask-sudo-pass may be your friend here. > > I did try an upgrade from 1.2 to 1.4 just in case there

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-21 Thread Michael DeHaan
Also make sure you're running with a recent Ansible, Ansible 1.4 is now the latest release. Newer versions (incl. later 1.3.X) will tell you if they get stuck waiting at a prompt in most cases. On Thu, Nov 21, 2013 at 8:02 PM, Michael DeHaan wrote: > "Instead of breaking right away, I ended u

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-21 Thread Michael DeHaan
"Instead of breaking right away, I ended up leaving for tea and found out it's hanging because it's expecting inputs." --ask-sudo-pass may be your friend here. On Thu, Nov 21, 2013 at 7:43 PM, Melissa Tan wrote: > I have attempted that in /etc/ansible/ansible.cfg with > > # the default sudo

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-21 Thread Melissa Tan
I have attempted that in /etc/ansible/ansible.cfg with # the default sudo executable. If a sudo alternative with a sudo-compatible interface # is used, specify its executable name as the default #sudo_exe=sudo *sudo_exe=/usr/local/bin/sudo* Instead of breaking right away, I ended up leaving fo

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-21 Thread Michael DeHaan
If you need to, you can specify a different sudo binary in ansible.cfg. You might wish to fully path it there. On Thu, Nov 21, 2013 at 3:15 PM, Brian Coca wrote: > in playbooks each task can set variables using the environment: var=val, > keyword, but I don't think there is currently no way

Re: [ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-21 Thread Brian Coca
in playbooks each task can set variables using the environment: var=val, keyword, but I don't think there is currently no way to do this for the ansible 1 liner. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group a

[ansible-project] Is there a way to set ENV variable on target hosts?

2013-11-21 Thread Melissa Tan
The -U SUDO_USER is not really working for me because Ansible can't find sudo. The root cause appears that it isn't set in the target hosts bash shell $PATH variable because Ansible doesn't seem to load in the .bash_profile or .profile I don't have root on the target machines to setup a sudo s