This failed because you have a command returning "rc":2. It did not time out.
"There seems to be an environment difference from when Ansible does SSH to execute the command versus what you are doing locally" Ansible does not load the remote environment intentionally. See http://docs.ansible.com/playbooks_environment.html if you need to set enviroment variables. Since you got six minutes in, it seems like it was compiling for six minutes and that's ok. Now, it would be preferred to do your compiling on your build system, package something, and then just download the packages with your package manager - compiling on individual machines is a deployment practice most people seek to avoid. On Thu, Oct 23, 2014 at 8:04 PM, Michael Hoglan <[email protected]> wrote: > Are you relying on .bashrc to load the environment for the user you are > using to SSH with? There seems to be an environment difference from when > Ansible does SSH to execute the command versus what you are doing locally. > Try doing a debug by registering the command which g++ > - name: Check location of program > command: which g++ > register: result > - debug: var=result > > Is this doing a sudo? sudo command will not source the .bashrc > automatically. > > I worked around it in my system with > - name: run script > shell: cd; bash -lc "script.sh > script.log 2>&1" > > This forces the .bashrc to be loaded. I had LD_LIBRARY_PATH defined in my > .bashrc that I needed to be loaded when executing the script. I know there > are a dozen other ways probably could have been done, but due to legacy > install reasons with my product, I was stuck with these ENV settings being > in .bashrc, and I was not interested in trying to pull those ENV values > over into my playbooks to prepend to the shell command. > > May not be your issue, but I suspect a similar problem as it looks like > make is looking for g++ / c++ and not finding it. > > Lastly, I have ran into issues with TTY due to nested SSH and > redirections, that is another area to check out when trying to execute > applications remotely, that they behave when the TTY is / is not present. > Doubt this is the case with make, but thought I would throw it out there in > case it sprung a lightbulb. > > Thanks! > Michael > > > On Thursday, October 23, 2014 3:37:22 PM UTC-5, Federico Aguirre wrote: >> >> More about... >> >> This is the error... >> >> failed: [server] => (item=/usr/bin/make) => {"changed": true, "cmd": "cd >> /home/user/platform ; /usr/bin/make", "delta": "0:05:34.773058", "end": >> "2014-10-23 20:13:10.664475", "item": "/usr/bin/make", "rc": 2, "start": >> "2014-10-23 20:07:35.891417"} >> stderr: Checking for program g++ or c++ : /usr/bin/g++ >> >> >> ani suggestion? >> >> Thanks, >> Fede >> El jueves, 23 de octubre de 2014 16:31:41 UTC-3, Federico Aguirre >> escribió: >>> >>> Hi there... >>> >>> I'm trying with a playbook in where i have to do a "make all". The >>> problem here is that after 5 or 6 minutes running, it finishes with error: >>> >>> "FATAL: all hosts have already failed -- aborting" >>> >>> But there's not compile error or something like that. If I run this >>> "make all" from command line, it finishes normally with $? = 0. >>> >>> Could be a "Ansible TO" >>> >>> Always finishes at the same point. >>> >>> Hope you could help me :) >>> >>> Regards.! >>> Fede >>> >>> Federico Aguirre >>> >> -- > 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/a9f5bcdb-1d13-4374-881d-ae8983acbc50%40googlegroups.com > <https://groups.google.com/d/msgid/ansible-project/a9f5bcdb-1d13-4374-881d-ae8983acbc50%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/CA%2BnsWgw%2BLNz5ExLdpVUANYq0tsZgynk36UepmWrd4JXoYX6ieA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
