rvm / rvm1-ansible

The official ansible RVM role to install and manage your Ruby versions.
MIT License
270 stars 136 forks source link

Ansible --check mode fails on "Delete ruby if relevant" #218

Closed thbar closed 4 years ago

thbar commented 4 years ago

While working on maintenance for a client, I noticed that #212 will fail when I run in --check mode:

TASK [rvm.ruby : List installed versions of Ruby (for deletion)] ****************************************************************************
skipping: [vagrant-xyz]

TASK [rvm.ruby : Delete ruby if relevant] ***************************************************************************************************
fatal: [vagrant-xyz]: FAILED! => 
  msg: |-
    The conditional check 'rvm1_delete_ruby in rvm1_list_installed_rubies.stdout.splitlines()' failed. The error was: error while evaluating conditional (rvm1_delete_ruby in rvm1_list_installed_rubies.stdout.splitlines()): 'dict object' has no attribute 'stdout'

    The error appears to be in '/REDACTED/roles/rvm.ruby/tasks/rubies.yml': line 71, column 3, but may
    be elsewhere in the file depending on the exact syntax problem.

    The offending line appears to be:

    - name: Delete ruby if relevant
      ^ here

The list check just before is skipped, resulting in that error.

This is not necessarily a blocker, but it will be better to fix that at some point because --check mode is an important feature of Ansible.

Poke @danochoa in case you happen to test this out later!

gildegoma commented 4 years ago

I baked something to run some --check tests during the CI builds. I may propose it as part of #219, or simply after this one get merged.