{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/36825","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/36825/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/36825/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/36825/events","html_url":"https://github.com/ansible/ansible/issues/36825","id":300916469,"number":36825,"title":"openssl_certificate fails to write Let's Encrypt signed cert with Python 3","user":{"login":"jdoss","id":8195,"avatar_url":"https://avatars0.githubusercontent.com/u/8195?v=4","gravatar_id":"","url":"https://api.github.com/users/jdoss","html_url":"https://github.com/jdoss","followers_url":"https://api.github.com/users/jdoss/followers","following_url":"https://api.github.com/users/jdoss/following{/other_user}","gists_url":"https://api.github.com/users/jdoss/gists{/gist_id}","starred_url":"https://api.github.com/users/jdoss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdoss/subscriptions","organizations_url":"https://api.github.com/users/jdoss/orgs","repos_url":"https://api.github.com/users/jdoss/repos","events_url":"https://api.github.com/users/jdoss/events{/privacy}","received_events_url":"https://api.github.com/users/jdoss/received_events","type":"User","site_admin":false},"labels":[{"id":562292166,"url":"https://api.github.com/repos/ansible/ansible/labels/affects_2.4","name":"affects_2.4","color":"ededed","default":false},{"id":785271699,"url":"https://api.github.com/repos/ansible/ansible/labels/bug","name":"bug","color":"fbca04","default":true},{"id":496359346,"url":"https://api.github.com/repos/ansible/ansible/labels/module","name":"module","color":"1d76db","default":false},{"id":383076471,"url":"https://api.github.com/repos/ansible/ansible/labels/python3","name":"python3","color":"fbca04","default":false},{"id":636327968,"url":"https://api.github.com/repos/ansible/ansible/labels/support:community","name":"support:community","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-28T07:17:19Z","updated_at":"2018-03-20T01:48:17Z","closed_at":"2018-03-20T01:48:16Z","author_association":"NONE","body":"##### ISSUE TYPE\r\n - Bug Report\r\n\r\n##### COMPONENT NAME\r\nopenssl_certificate\r\n\r\n##### ANSIBLE VERSION\r\n```\r\nansible 2.4.2.0\r\n  config file = ./ansible.cfg\r\n  configured module search path = [u'~/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']\r\n  ansible python module location = /usr/lib/python2.7/site-packages/ansible\r\n  executable location = /usr/bin/ansible\r\n  python version = 2.7.14 (default, Jan 17 2018, 14:28:32) [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)]\r\n```\r\n\r\n##### OS / ENVIRONMENT\r\n\r\nFedora 27 Workstation \r\nFedora 27 Server (Target)\r\n\r\n##### SUMMARY\r\nGenerating a Let's Encrypt cert fail when using `ansible_python_interpreter=/usr/bin/python3`\r\n\r\n##### STEPS TO REPRODUCE\r\nGenerate a Let's Encrypt Certificate \r\n\r\n<!--- Paste example playbooks or commands between quotes below -->\r\n```yaml\r\n- name: Generate a Let's Encrypt Certificate\r\n  openssl_certificate:\r\n    path: /etc/ssl/crt/ansible.com.crt\r\n    csr_path: /etc/ssl/csr/ansible.com.csr\r\n    provider: acme\r\n    acme_accountkey: /etc/ssl/private/ansible.com.pem\r\n    acme_challenge_path: /etc/ssl/challenges/ansible.com/\r\n\r\n```\r\n\r\n\r\n##### EXPECTED RESULTS\r\n\r\nA signed SSL cert written to a file. \r\n\r\n##### ACTUAL RESULTS\r\n```\r\n\r\nfatal: [server]: FAILED! => {\"changed\": false, \"module_stderr\": \"Parsing account key...\\nParsing CSR...\\nRegistering account...\\nAlready registered!\\nVerifying cdn1.transistor.fm...\\ncdn1.transistor.fm verified!\\nSigning certificate...\\nCertificate signed!\\nTraceback (most recent call last):\\n  File \\\"/tmp/ansible_1ezavkpq/ansible_module_openssl_certificate.py\\\", line 808, in <module>\\n    main()\\n  File \\\"/tmp/ansible_1ezavkpq/ansible_module_openssl_certificate.py\\\", line 787, in main\\n    certificate.generate(module)\\n  File \\\"/tmp/ansible_1ezavkpq/ansible_module_openssl_certificate.py\\\", line 692, in generate\\n    certfile.write(str(crt))\\nTypeError: a bytes-like object is required, not 'str'\\n\", \"module_stdout\": \"\", \"msg\": \"MODULE FAILURE\", \"rc\": 1}\r\n\r\n```\r\n\r\nInstalling Python 2 and the following modules on the target server fixes the issue.\r\n\r\n`dnf install -y python2 python2-dnf libselinux-python python-pyOpenSSL`\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/374444592","html_url":"https://github.com/ansible/ansible/issues/36825#issuecomment-374444592","issue_url":"https://api.github.com/repos/ansible/ansible/issues/36825","id":374444592,"user":{"login":"abadger","id":209242,"avatar_url":"https://avatars2.githubusercontent.com/u/209242?v=4","gravatar_id":"","url":"https://api.github.com/users/abadger","html_url":"https://github.com/abadger","followers_url":"https://api.github.com/users/abadger/followers","following_url":"https://api.github.com/users/abadger/following{/other_user}","gists_url":"https://api.github.com/users/abadger/gists{/gist_id}","starred_url":"https://api.github.com/users/abadger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abadger/subscriptions","organizations_url":"https://api.github.com/users/abadger/orgs","repos_url":"https://api.github.com/users/abadger/repos","events_url":"https://api.github.com/users/abadger/events{/privacy}","received_events_url":"https://api.github.com/users/abadger/received_events","type":"User","site_admin":false},"created_at":"2018-03-20T01:48:16Z","updated_at":"2018-03-20T01:48:16Z","author_association":"MEMBER","body":"@jdoss I've now backported #35143 to the stbale-2.4 branch so it will be in the 2.4.4 release."}}
{"actor":{"display_login":"abadger"}}