{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/41307","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/41307/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/41307/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/41307/events","html_url":"https://github.com/ansible/ansible/issues/41307","id":330545486,"node_id":"MDU6SXNzdWUzMzA1NDU0ODY=","number":41307,"title":"s3 cloudfront_distribution: Expected a list, got a odict_values with value odict_values","user":{"login":"bmamouri","id":6419173,"node_id":"MDQ6VXNlcjY0MTkxNzM=","avatar_url":"https://avatars2.githubusercontent.com/u/6419173?v=4","gravatar_id":"","url":"https://api.github.com/users/bmamouri","html_url":"https://github.com/bmamouri","followers_url":"https://api.github.com/users/bmamouri/followers","following_url":"https://api.github.com/users/bmamouri/following{/other_user}","gists_url":"https://api.github.com/users/bmamouri/gists{/gist_id}","starred_url":"https://api.github.com/users/bmamouri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmamouri/subscriptions","organizations_url":"https://api.github.com/users/bmamouri/orgs","repos_url":"https://api.github.com/users/bmamouri/repos","events_url":"https://api.github.com/users/bmamouri/events{/privacy}","received_events_url":"https://api.github.com/users/bmamouri/received_events","type":"User","site_admin":false},"labels":[{"id":686214011,"node_id":"MDU6TGFiZWw2ODYyMTQwMTE=","url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.5","name":"affects_2.5","color":"ededed","default":false},{"id":379680333,"node_id":"MDU6TGFiZWwzNzk2ODAzMzM=","url":"https://api.github.com/repos/ansible/ansible/labels/aws","name":"aws","color":"c5def5","default":false},{"id":785271699,"node_id":"MDU6TGFiZWw3ODUyNzE2OTk=","url":"https://api.github.com/repos/ansible/ansible/labels/bug","name":"bug","color":"fbca04","default":true},{"id":61528803,"node_id":"MDU6TGFiZWw2MTUyODgwMw==","url":"https://api.github.com/repos/ansible/ansible/labels/cloud","name":"cloud","color":"c7def8","default":false},{"id":496359346,"node_id":"MDU6TGFiZWw0OTYzNTkzNDY=","url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":383076471,"node_id":"MDU6TGFiZWwzODMwNzY0NzE=","url":"https://api.github.com/repos/ansible/ansible/labels/python3","name":"python3","color":"fbca04","default":false},{"id":636327968,"node_id":"MDU6TGFiZWw2MzYzMjc5Njg=","url":"https://api.github.com/repos/ansible/ansible/labels/support:community","name":"support:community","color":"ededed","default":false},{"id":942378949,"node_id":"MDU6TGFiZWw5NDIzNzg5NDk=","url":"https://api.github.com/repos/ansible/ansible/labels/traceback","name":"traceback","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-08T07:15:51Z","updated_at":"2018-06-08T10:16:01Z","closed_at":null,"author_association":"NONE","body":"##### SUMMARY\r\nThis issue might be related to this PR: https://github.com/ansible/ansible/pull/37340\r\n\r\n##### ISSUE TYPE\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\ncloudfront_distribution\r\n\r\n##### ANSIBLE VERSION\r\n<!--- Paste, BELOW THIS COMMENT, verbatim output from \"ansible --version\" between quotes below -->\r\n```\r\nansible 2.5.2\r\n  config file = /Users/redacted/wattcost/deployment/presentation/ansible.cfg\r\n  configured module search path = ['/Users/baqer/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /Users/baqer/.local/share/virtualenvs/deployment-urGlj6Al/lib/python3.6/site-packages/ansible\r\n  executable location = /Users/redacted/.local/share/virtualenvs/deployment-urGlj6Al/bin/ansible\r\n  python version = 3.6.5 (default, Apr 12 2018, 13:43:59) [GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.1)]\r\n```\r\n\r\n##### CONFIGURATION\r\nANSIBLE_SSH_ARGS(/Users/redacted/ansible.cfg) = -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=/tmp/ansible-ssh-%h-%p\r\nHOST_KEY_CHECKING(/Users/redacted/ansible.cfg) = False\r\n\r\n##### OS / ENVIRONMENT\r\n<!--- Mention, BELOW THIS COMMENT, the OS you are running Ansible from, and the OS you are\r\nmanaging, or say \"N/A\" for anything that is not platform-specific.\r\nAlso mention the specific version of what you are trying to control,\r\ne.g. if this is a network bug the version of firmware on the network device.-->\r\n\r\n##### STEPS TO REPRODUCE\r\n<!--- For bugs, show exactly how to reproduce the problem, using a minimal test-case.\r\nFor new features, show how the feature would be used. -->\r\n\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```yaml\r\n---\r\n- name: Set domain URL\r\n  set_fact:\r\n    domain_name: \"admin{{ '-' + env if env in ['dev', 'staging'] else '' }}.{{ route53.hosted_zone }}\"\r\n\r\n- name:\r\n  debug:\r\n    msg: '{{ domain_name }}'\r\n\r\n- name: create Cloudfront distribution\r\n  cloudfront_distribution:\r\n    state: present\r\n    alias: '{{ domain_name }}'\r\n    default_root_object: index.html\r\n    origins:\r\n      - id: 'S3-{{ domain_name }}'\r\n        domain_name: '{{ bucket_name }}.s3.amazonaws.com'\r\n        origin_path: ''\r\n        s3_origin_access_identity_enabled: yes\r\n    default_cache_behavior:\r\n      target_origin_id: 'S3-{{ domain_name }}'\r\n      viewer_protocol_policy: redirect-to-https\r\n      allowed_methods:\r\n        items:\r\n          - GET\r\n          - HEAD\r\n        cached_methods:\r\n          - GET\r\n          - HEAD\r\n      forwarded_values:\r\n        query_string: false\r\n        cookies:\r\n          forward: none\r\n      smooth_streaming: false\r\n      compress: false\r\n    custom_error_responses:\r\n      - error_code: 403\r\n        response_page_path: '/index.html'\r\n        response_code: 200\r\n        error_caching_min_ttl: 300\r\n    logging:\r\n      enabled: true\r\n      include_cookies: false\r\n      bucket: hatch-logs.s3.amazonaws.com\r\n      prefix: 'admin-web-cloudfront/{{ env }}/'\r\n    enabled: true\r\n    price_class: PriceClass_100\r\n    viewer_certificate:\r\n      acm_certificate_arn: arn:aws:acm:us-east-1:966878126306:certificate/XXX\r\n      minimum_protocol_version: TLSv1.1_2016\r\n      ssl_support_method: sni-only\r\n    http_version: http2\r\n    ipv6_enabled: yes\r\n  register: cf\r\n```\r\n\r\n##### EXPECTED RESULTS\r\nNot get error\r\n\r\n##### ACTUAL RESULTS\r\n```\r\nUsing module file /Users/redacted/.local/share/virtualenvs/deployment-urGlj6Al/lib/python3.6/site-packages/ansible/modules/cloud/amazon/cloudfront_distribution.py\r\n<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: redacted\r\n<127.0.0.1> EXEC /bin/sh -c 'echo ~ && sleep 0'\r\n<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p \"` echo /Users/redacted/.ansible/tmp/ansible-tmp-1528441907.4115431-142370866965291 `\" && echo ansible-tmp-1528441907.4115431-142370866965291=\"` echo /Users/redacted/.ansible/tmp/ansible-tmp-1528441907.4115431-142370866965291 `\" ) && sleep 0'\r\n<127.0.0.1> PUT /Users/redacted/.ansible/tmp/ansible-local-38981lx2fpuw3/tmpmr5wa37z TO /Users/redacted/.ansible/tmp/ansible-tmp-1528441907.4115431-142370866965291/cloudfront_distribution.py\r\n<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /Users/redacted/.ansible/tmp/ansible-tmp-1528441907.4115431-142370866965291/ /Users/redacted/.ansible/tmp/ansible-tmp-1528441907.4115431-142370866965291/cloudfront_distribution.py && sleep 0'\r\n<127.0.0.1> EXEC /bin/sh -c '/Users/redacted/.local/share/virtualenvs/deployment-urGlj6Al/bin/python3.6m /Users/redacted/.ansible/tmp/ansible-tmp-1528441907.4115431-142370866965291/cloudfront_distribution.py && sleep 0'\r\n<127.0.0.1> EXEC /bin/sh -c 'rm -f -r /Users/redacted/.ansible/tmp/ansible-tmp-1528441907.4115431-142370866965291/ > /dev/null 2>&1 && sleep 0'\r\nThe full traceback is:\r\nTraceback (most recent call last):\r\n  File \"/var/folders/pt/scv7gx297rg5ns2nt1f2w90r0000gn/T/ansible_hph1d47g/ansible_module_cloudfront_distribution.py\", line 1414, in validate_origins\r\n    return ansible_list_to_cloudfront_list(all_origins.values())\r\n  File \"/var/folders/pt/scv7gx297rg5ns2nt1f2w90r0000gn/T/ansible_hph1d47g/ansible_module_cloudfront_distribution.py\", line 1138, in ansible_list_to_cloudfront_list\r\n    raise ValueError('Expected a list, got a {0} with value {1}'.format(type(list_items).__name__, str(list_items)))\r\nValueError: Expected a list, got a odict_values with value odict_values([{'id': 'S3-admin-dev.redacted.net', 'domain_name': 'admin-dev.redacted.net.s3.amazonaws.com', 'origin_path': '', 'custom_headers': {'quantity': 0}, 's3_origin_config': {'origin_access_identity': 'origin-access-identity/cloudfront/E352DFCNFOKYBB'}}])\r\n\r\nfatal: [localhost]: FAILED! => {\r\n    \"changed\": false,\r\n    \"invocation\": {\r\n        \"module_args\": {\r\n            \"alias\": \"admin-dev.redacted.net\",\r\n            \"aliases\": [\r\n                \"admin-dev.redacted.net\"\r\n            ],\r\n            \"aws_access_key\": null,\r\n            \"aws_secret_key\": null,\r\n            \"cache_behaviors\": null,\r\n            \"caller_reference\": null,\r\n            \"comment\": null,\r\n            \"custom_error_responses\": [\r\n                {\r\n                    \"error_caching_min_ttl\": 300,\r\n                    \"error_code\": 403,\r\n                    \"response_code\": 200,\r\n                    \"response_page_path\": \"/index.html\"\r\n                }\r\n            ],\r\n            \"default_cache_behavior\": {\r\n                \"allowed_methods\": {\r\n                    \"cached_methods\": [\r\n                        \"GET\",\r\n                        \"HEAD\"\r\n                    ],\r\n                    \"items\": [\r\n                        \"GET\",\r\n                        \"HEAD\"\r\n                    ]\r\n                },\r\n                \"compress\": false,\r\n                \"forwarded_values\": {\r\n                    \"cookies\": {\r\n                        \"forward\": \"none\"\r\n                    },\r\n                    \"query_string\": false\r\n                },\r\n                \"smooth_streaming\": false,\r\n                \"target_origin_id\": \"S3-admin-dev.redacted.net\",\r\n                \"viewer_protocol_policy\": \"redirect-to-https\"\r\n            },\r\n            \"default_origin_domain_name\": null,\r\n            \"default_origin_path\": null,\r\n            \"default_root_object\": \"index.html\",\r\n            \"distribution_id\": null,\r\n            \"e_tag\": null,\r\n            \"ec2_url\": null,\r\n            \"enabled\": true,\r\n            \"http_version\": \"http2\",\r\n            \"ipv6_enabled\": true,\r\n            \"logging\": {\r\n                \"bucket\": \"hatch-logs.s3.amazonaws.com\",\r\n                \"enabled\": true,\r\n                \"include_cookies\": false,\r\n                \"prefix\": \"admin-web-cloudfront/dev/\"\r\n            },\r\n            \"origins\": [\r\n                {\r\n                    \"custom_headers\": {\r\n                        \"quantity\": 0\r\n                    },\r\n                    \"domain_name\": \"admin-dev.redacted.net.s3.amazonaws.com\",\r\n                    \"id\": \"S3-admin-dev.redacted.net\",\r\n                    \"origin_path\": \"\",\r\n                    \"s3_origin_config\": {\r\n                        \"origin_access_identity\": \"origin-access-identity/cloudfront/E352DFCNFOKYBB\"\r\n                    }\r\n                }\r\n            ],\r\n            \"price_class\": \"PriceClass_100\",\r\n            \"profile\": null,\r\n            \"purge_aliases\": false,\r\n            \"purge_cache_behaviors\": false,\r\n            \"purge_custom_error_responses\": false,\r\n            \"purge_origins\": false,\r\n            \"purge_tags\": false,\r\n            \"region\": null,\r\n            \"restrictions\": null,\r\n            \"security_token\": null,\r\n            \"state\": \"present\",\r\n            \"tags\": {},\r\n            \"validate_certs\": true,\r\n            \"viewer_certificate\": {\r\n                \"acm_certificate_arn\": \"arn:aws:acm:us-east-1:966878126306:certificate/XXX\",\r\n                \"minimum_protocol_version\": \"TLSv1.1_2016\",\r\n                \"ssl_support_method\": \"sni-only\"\r\n            },\r\n            \"wait\": false,\r\n            \"wait_timeout\": 1800,\r\n            \"web_acl_id\": null\r\n        }\r\n    },\r\n    \"msg\": \"Error validating distribution origins: Expected a list, got a odict_values with value odict_values([{'id': 'S3-admin-dev.redacted.net', 'domain_name': 'admin-dev.redacted.net.s3.amazonaws.com', 'origin_path': '', 'custom_headers': {'quantity': 0}, 's3_origin_config': {'origin_access_identity': 'origin-access-identity/cloudfront/E352DFCNFOKYBB'}}])\"\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/395717551","html_url":"https://github.com/ansible/ansible/issues/41307#issuecomment-395717551","issue_url":"https://api.github.com/repos/ansible/ansible/issues/41307","id":395717551,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTcxNzU1MQ==","user":{"login":"willthames","id":391807,"node_id":"MDQ6VXNlcjM5MTgwNw==","avatar_url":"https://avatars2.githubusercontent.com/u/391807?v=4","gravatar_id":"","url":"https://api.github.com/users/willthames","html_url":"https://github.com/willthames","followers_url":"https://api.github.com/users/willthames/followers","following_url":"https://api.github.com/users/willthames/following{/other_user}","gists_url":"https://api.github.com/users/willthames/gists{/gist_id}","starred_url":"https://api.github.com/users/willthames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willthames/subscriptions","organizations_url":"https://api.github.com/users/willthames/orgs","repos_url":"https://api.github.com/users/willthames/repos","events_url":"https://api.github.com/users/willthames/events{/privacy}","received_events_url":"https://api.github.com/users/willthames/received_events","type":"User","site_admin":false},"created_at":"2018-06-08T10:16:01Z","updated_at":"2018-06-08T10:16:01Z","author_association":"CONTRIBUTOR","body":"I've raised #41315 as a backport PR."}}
{"actor":{"display_login":"willthames"}}