rvm / rvm1-ansible

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

Role GPG key tasks fail when run in --check mode #150

Closed geerlingguy closed 7 years ago

geerlingguy commented 7 years ago

When I run a playbook with --check mode (to verify my server's configuration without making any changes), the playbook run fails on the following tasks:

TASK [rvm_io.ruby : Import GPG keys] ***********************************************************************************
fatal: [server]: FAILED! => {"failed": true, "msg": "The conditional check 'gpg_result.rc == 0' failed. The error was: error while evaluating conditional (gpg_result.rc == 0): 'dict object' has no attribute 'rc'"}
...ignoring

TASK [rvm_io.ruby : Import GPG keys the other way] *********************************************************************
fatal: [server]: FAILED! => {"failed": true, "msg": "The conditional check 'rvm1_gpg_keys != '' and gpg_result.rc != 0' failed. The error was: error while evaluating conditional (rvm1_gpg_keys != '' and gpg_result.rc != 0): 'dict object' has no attribute 'rc'\n\nThe error appears to have been in '/path/to/project/roles/rvm_io.ruby/tasks/rvm.yml': line 34, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n\n- name: Import GPG keys the other way\n  ^ here\n"}

I'm testing a quick fix for this and will file a PR if it works.

geerlingguy commented 7 years ago

PR: https://github.com/rvm/rvm1-ansible/pull/151