{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/50466","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/50466/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/50466/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/50466/events","html_url":"https://github.com/ansible/ansible/issues/50466","id":395364663,"node_id":"MDU6SXNzdWUzOTUzNjQ2NjM=","number":50466,"title":"aws_ssm lookup does not fail when parameter does not exist","user":{"login":"tinyzimmer","id":38474291,"node_id":"MDQ6VXNlcjM4NDc0Mjkx","avatar_url":"https://avatars1.githubusercontent.com/u/38474291?v=4","gravatar_id":"","url":"https://api.github.com/users/tinyzimmer","html_url":"https://github.com/tinyzimmer","followers_url":"https://api.github.com/users/tinyzimmer/followers","following_url":"https://api.github.com/users/tinyzimmer/following{/other_user}","gists_url":"https://api.github.com/users/tinyzimmer/gists{/gist_id}","starred_url":"https://api.github.com/users/tinyzimmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tinyzimmer/subscriptions","organizations_url":"https://api.github.com/users/tinyzimmer/orgs","repos_url":"https://api.github.com/users/tinyzimmer/repos","events_url":"https://api.github.com/users/tinyzimmer/events{/privacy}","received_events_url":"https://api.github.com/users/tinyzimmer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-01-02T20:09:19Z","updated_at":"2019-01-02T20:10:39Z","closed_at":null,"author_association":"NONE","body":"##### SUMMARY\r\n\r\nUsing the `aws_ssm` lookup plugin to fetch an application secret, if the parameter does not exist, the plugin will fail silently setting an empty string for the queried `value`.\r\n\r\n##### ISSUE TYPE\r\n\r\n- Bug Report\r\n\r\n##### COMPONENT NAME\r\n\r\n`aws_ssm`\r\n\r\n##### ANSIBLE VERSION\r\n\r\n2.7.5\r\n\r\n##### CONFIGURATION\r\n\r\n```\r\nuser@somecomputer /cygdrive/c/Users/{{ redacted }}/Development/{{ redacted }}\r\n$ ansible-config dump --only-changed\r\n\r\nuser@somecomputer /cygdrive/c/Users/{{ redacted }}/Development/{{ redacted }}\r\n$\r\n```\r\n\r\n##### OS / ENVIRONMENT\r\n\r\nRunning in Cygwin on Windows 10 Pro (work computer 🤢) but likely affects other platforms?\r\n\r\n##### STEPS TO REPRODUCE\r\n\r\n```yaml\r\n# test.yml\r\n- name: Test Param Retrieval\r\n  hosts: localhost\r\n  gather_facts: false\r\n  tasks:\r\n\r\n    # I'd expect this to fail\r\n    - set_fact:\r\n        test_var: \"{{ lookup('aws_ssm', 'nonexistant_param', region='us-east-1') }}\"\r\n\r\n    - debug:\r\n        var: test_var\r\n```\r\n\r\n##### EXPECTED RESULTS\r\n\r\nFail because of non-existent parameter. Since it wasn't failing, I had no idea I was using the wrong AWS Shared Credentials Profile on the computer I was running this from. If this is expected behavior I suppose that's fine, but I don't see why it would be.\r\n\r\n##### ACTUAL RESULTS\r\n\r\nPlaybook continues and any templates that use that value set it to an empty string\r\n\r\n```bash\r\n$ ansible-playbook test.yml\r\n [WARNING]: Unable to parse /etc/ansible/hosts as an inventory source\r\n\r\n [WARNING]: No inventory was parsed, only implicit localhost is available\r\n\r\n [WARNING]: provided hosts list is empty, only localhost is available. Note\r\nthat the implicit localhost does not match 'all'\r\n\r\n\r\nPLAY [Test Param Retrieval] ****************************************************\r\n\r\nTASK [set_fact] ****************************************************************\r\nok: [localhost]\r\n\r\nTASK [debug] *******************************************************************\r\nok: [localhost] => {\r\n    \"test_var\": \"\"\r\n}\r\n\r\nPLAY RECAP *********************************************************************\r\nlocalhost                  : ok=2    changed=0    unreachable=0    failed=0\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/450971124","html_url":"https://github.com/ansible/ansible/issues/50466#issuecomment-450971124","issue_url":"https://api.github.com/repos/ansible/ansible/issues/50466","id":450971124,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDk3MTEyNA==","user":{"login":"ansibot","id":6585283,"node_id":"MDQ6VXNlcjY1ODUyODM=","avatar_url":"https://avatars0.githubusercontent.com/u/6585283?v=4","gravatar_id":"","url":"https://api.github.com/users/ansibot","html_url":"https://github.com/ansibot","followers_url":"https://api.github.com/users/ansibot/followers","following_url":"https://api.github.com/users/ansibot/following{/other_user}","gists_url":"https://api.github.com/users/ansibot/gists{/gist_id}","starred_url":"https://api.github.com/users/ansibot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansibot/subscriptions","organizations_url":"https://api.github.com/users/ansibot/orgs","repos_url":"https://api.github.com/users/ansibot/repos","events_url":"https://api.github.com/users/ansibot/events{/privacy}","received_events_url":"https://api.github.com/users/ansibot/received_events","type":"User","site_admin":false},"created_at":"2019-01-02T20:10:39Z","updated_at":"2019-01-02T20:10:39Z","author_association":"CONTRIBUTOR","body":"Files identified in the description:\n* [lib/ansible/plugins/lookup/aws_ssm.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/lookup/aws_ssm.py)\n\nIf these files are inaccurate, please update the `component name` section of the description or use the `!component` bot command.\n\n[click here for bot help](https://github.com/ansible/ansibullbot/blob/master/ISSUE_HELP.md)\n<!--- boilerplate: components_banner --->"}}
{"actor":{"display_login":"ansibot"}}