{"action":"opened","issue":{"url":"https://api.github.com/repos/rvm/rvm1-ansible/issues/136","repository_url":"https://api.github.com/repos/rvm/rvm1-ansible","labels_url":"https://api.github.com/repos/rvm/rvm1-ansible/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/rvm/rvm1-ansible/issues/136/comments","events_url":"https://api.github.com/repos/rvm/rvm1-ansible/issues/136/events","html_url":"https://github.com/rvm/rvm1-ansible/issues/136","id":203206573,"number":136,"title":"import gpg tasks fail in check mode","user":{"login":"yithian","id":352965,"avatar_url":"https://avatars.githubusercontent.com/u/352965?v=3","gravatar_id":"","url":"https://api.github.com/users/yithian","html_url":"https://github.com/yithian","followers_url":"https://api.github.com/users/yithian/followers","following_url":"https://api.github.com/users/yithian/following{/other_user}","gists_url":"https://api.github.com/users/yithian/gists{/gist_id}","starred_url":"https://api.github.com/users/yithian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yithian/subscriptions","organizations_url":"https://api.github.com/users/yithian/orgs","repos_url":"https://api.github.com/users/yithian/repos","events_url":"https://api.github.com/users/yithian/events{/privacy}","received_events_url":"https://api.github.com/users/yithian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-25T19:59:40Z","updated_at":"2017-01-25T19:59:40Z","closed_at":null,"body":"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.\r\n\r\nIt 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.\r\n\r\n```\r\nTASK [rvm_io.ruby : Import GPG keys] *******************************************\r\nfatal: [void.yuggoth.space]: 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'\"}\r\n...ignoring\r\n\r\nTASK [rvm_io.ruby : Import GPG keys the other way] *****************************\r\nfatal: [void.yuggoth.space]: 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\"}\r\n        to retry, use: --limit @.../webserver.retry\r\n```"}}
{"actor":{"display_login":"yithian"}}