When running a playbook that uses the rvm_io.ruby role in check mode (ansible-playbook ... -C), the tasks to import GPG keys via the command and shell modules both fail. The failure from the shell module gpg key task (Import GPG keys the other way) causes the entire run to exit.
It appears to be due to the fact that the command task doesn't actually execute during check mode, which means that its output doesn't get registered to the gpg_result variable. Then when the tasks examine gpg_result for its rc key during the until clause, it's not present.
TASK [rvm_io.ruby : Import GPG keys] *******************************************
fatal: [hostname]: 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: [hostname]: 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 '/etc/ansible/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"}
to retry, use: --limit @.../webserver.retry
When running a playbook that uses the rvm_io.ruby role in check mode (
ansible-playbook ... -C
), the tasks to import GPG keys via the command and shell modules both fail. The failure from the shell module gpg key task (Import GPG keys the other way) causes the entire run to exit.It appears to be due to the fact that the command task doesn't actually execute during check mode, which means that its output doesn't get registered to the gpg_result variable. Then when the tasks examine gpg_result for its rc key during the until clause, it's not present.