title: Install Rbenv using Ansible
body: <p>I am trying to install Rbenv on my server using Ansible but getting this error:</p>
  
  <blockquote>
    <p>TASK: [rbenv | create temporary directory] <strong><em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>****</strong>
    fatal: [localhost] => Conditional expression must evaluate to True or False: is_failed($rbuild_present)</p>
    
    <p>FATAL: all hosts have already failed -- aborting</p>
  </blockquote>
  
  <p>My playbook is:</p>
  
  <pre><code>---
  - name: rbenv | update rbenv repo
    git: repo=git://github.com/sstephenson/rbenv.git
         dest=$rbenv_root
         version=v0.4.0
  
  - name: rbenv | add rbenv to path
    file: path=/usr/local/bin/rbenv
          src=${rbenv_root}/bin/rbenv
          state=link
  
  - name: rbenv | add rbenv initialization to profile
    template: src=templates/rbenv.sh.j2
              dest=/etc/profile.d/rbenv.sh
              owner=root
              group=root
              mode=0755
  
  - name: rbenv | check ruby-build installed
    command: test -x /usr/local/bin/ruby-build
    register: rbuild_present
    ignore_errors: yes
  
  - name: rbenv | create temporary directory
    shell: mktemp -d
    register: tempdir
    when_failed: $rbuild_present
  
  - name: rbenv | clone ruby-build repo
    git: repo=git://github.com/sstephenson/ruby-build.git
         dest=${tempdir.stdout}/ruby-build
    when_failed: $rbuild_present
  
  - name: rbenv | install ruby-build
    command: ./install.sh
             chdir=${tempdir.stdout}/ruby-build
    when_failed: $rbuild_present
  
  - name: rbenv | remove temporary directory
    file: path=${tempdir.stdout} state=absent
    when_failed: $rbuild_present
  
  - name: rbenv | check ruby $ruby_version installed
    shell: RBENV_ROOT=${rbenv_root} rbenv versions | grep $ruby_version
    register: ruby_installed
    ignore_errors: yes
  
  - name: rbenv | install ruby $ruby_version
    shell: RBENV_ROOT=${rbenv_root} rbenv install $ruby_version
    when_failed: $ruby_installed
  
  - name: rbenv | set global ruby $ruby_version
    shell: RBENV_ROOT=${rbenv_root} rbenv global $ruby_version
    when_failed: $ruby_installed
  
  - name: rbenv | rehash
    shell: RBENV_ROOT=${rbenv_root} rbenv rehash
    when_failed: $ruby_installed
  
  - name: rbenv | set gemrc
    copy: src=files/gemrc
          dest=/root/.gemrc
          owner=root
          group=root
          mode=0644
  </code></pre>
  
  <p>Any ideas?</p>