Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grep not finding ruby version #53

Closed
colin-byrne-1 opened this issue Dec 29, 2015 · 2 comments · Fixed by #69
Closed

grep not finding ruby version #53

colin-byrne-1 opened this issue Dec 29, 2015 · 2 comments · Fixed by #69

Comments

@colin-byrne-1
Copy link

Hey,

So tasks are failing on a grep of the rbenv versions, and can't seem to find 2.2.2, my desired version. Of course '2.2.2' shows up in the version list so this doesn't make much sense. I got these first on a system install, then on a user install:

TASK: [zzet.rbenv | check ruby {{ rbenv.ruby_version }} installed for system] *** 

failed: [ansible] => {"changed": false, "cmd": "$SHELL -lc \"rbenv versions | grep 2.2.2\"", "delta": "0:00:00.071108", "end": "2015-12-29 19:19:48.077976", "rc": 1, "start": "2015-12-29 19:19:48.006868", "stdout_lines": [], "warnings": []}
...ignoring

also thrown on:

TASK: [zzet.rbenv | install ruby {{ rbenv.ruby_version }} for select users] *** 

failed: [ansible] => (item=[{u'cmd': u'$SHELL -lc "rbenv versions | grep 2.2.2"', u'end': u'2015-12-29 19:35:57.621104', u'stderr': u'', u'stdout': u'', u'changed': False, u'rc': 1, 'item': 'deploy', u'warnings': [], u'delta': u'0:00:00.073502', 'invocation': {'module_name': u'shell', 'module_complex_args': {}, 'module_args': u'$SHELL -lc "rbenv versions | grep 2.2.2"'}, 'stdout_lines': [], u'start': u'2015-12-29 19:35:57.547602'}, 'deploy']) => {"changed": true, "cmd": "$SHELL -lc \"rbenv install 2.2.2\"", "delta": "0:00:00.083065", "end": "2015-12-29 19:35:58.340299", "item": [{"changed": false, "cmd": "$SHELL -lc \"rbenv versions | grep 2.2.2\"", "delta": "0:00:00.073502", "end": "2015-12-29 19:35:57.621104", "invocation": {"module_args": "$SHELL -lc \"rbenv versions | grep 2.2.2\"", "module_complex_args": {}, "module_name": "shell"}, "item": "deploy", "rc": 1, "start": "2015-12-29 19:35:57.547602", "stderr": "", "stdout": "", "stdout_lines": [], "warnings": []}, "deploy"], "rc": 2, "start": "2015-12-29 19:35:58.257234", "warnings": []}
stderr: ruby-build: definition not found: 2.2.2

The following versions contain `2.2.2' in the name:
  rbx-2.2.2

See all available versions with `rbenv install --list'.

If the version you need is missing, try upgrading ruby-build:

  cd /home/deploy/.rbenv/plugins/ruby-build && git pull
...ignoring

and

TASK: [zzet.rbenv | check if user ruby version is {{ rbenv.ruby_version }}] *** 

failed: [ansible] => (item=deploy) => {"changed": false, "cmd": "$SHELL -lc \"rbenv version | cut -d ' ' -f 1 | grep -Fx '2.2.2'\"", "delta": "0:00:00.055444", "end": "2015-12-29 19:35:59.077912", "item": "deploy", "rc": 1, "start": "2015-12-29 19:35:59.022468", "stdout_lines": [], "warnings": []}

Thanks for any help!

@MatthiasWinkelmann
Copy link
Contributor

MatthiasWinkelmann commented Apr 17, 2016

This happened to me because I was running with strategy: debug which stops at any exception. Note that the task itself expects this and includes irgnore_errors: yes. Run it once without debug and it should work thereafter (though I'm not sure if that's the best solution).

Edit: Another possibility is to set failed_when: false.
(Also, this is the first time that I found my own comment when I was trying to solve a problem. Thanks me-6-days-ago)

@unnu
Copy link

unnu commented Sep 20, 2016

@zzet Is there a different way to implement the check without throwing errors? Having red output in ansible always captures my attention.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants