When I modified my wordpress_sites.yml file by adding www redirects, I get an error when I tried provisioning with the command ansible-playbook server.yml -e env=production
.
wordpress_sites: "MY_NON_WWW_SITE": site_hosts: - canonical: "MY_NON_WWW_SITE" redirects://<------Added this line - **MY_WWW_SITE**//<------Added this line local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root) repo: "MY_GIT_REPO_URL"# replace with your Git repo URL repo_subtree_path: site # relative path to your Bedrock/WP directory in your repo branch: master multisite: enabled: false ssl: enabled: true provider: letsencrypt cache: enabled: true
The error I got was:
non-zero return code
fatal: [165.227.169.116]: FAILED! => {“changed”: false, “cmd”: [“./renew-certs.py”], “delta”: “0:00:02.302412”, “end”: “2017-12-10 18:39:12.997138”, “failed”: true, “rc”: 1, “start”: “2017-12-10 18:39:10.694726”, “stderr”: “”, “stderr_lines”: , “stdout”: “Generating certificate for MY_NON_WWW_SITE\nError while generating certificate for MY_NON_WWW_SITE\nTraceback (most recent call last):\n File "/usr/local/letsencrypt/acme_tiny.py", line 198, in \n main(sys.argv[1:])\n File "/usr/local/letsencrypt/acme_tiny.py", line 194, in main\n signed_crt = get_crt(args.account_key, args.csr, args.acme_dir, log=LOGGER, CA=args.ca)\n File "/usr/local/letsencrypt/acme_tiny.py", line 123, in get_crt\n wellknown_path, wellknown_url))\nValueError: Wrote file to /srv/www/letsencrypt/YKfZ9QrJMgu_iD5bD_GR1h6KPUHSoh3K3VympkbsQuw, but couldn’t download MY_WWW_SITE/.well-known/acme-challenge/YKfZ9QrJMgu_iD5bD_GR1h6KPUHSoh3K3VympkbsQuw”, “stdout_lines”: [“Generating certificate for MY_NON_WWW_SITE”, “Error while generating certificate for MY_NON_WWW_SITE”, “Traceback (most recent call last):”, " File "/usr/local/letsencrypt/acme_tiny.py", line 198, in “, " main(sys.argv[1:])”, " File "/usr/local/letsencrypt/acme_tiny.py", line 194, in main", " signed_crt = get_crt(args.account_key, args.csr, args.acme_dir, log=LOGGER, CA=args.ca)“, " File "/usr/local/letsencrypt/acme_tiny.py", line 123, in get_crt”, " wellknown_path, wellknown_url))", “ValueError: Wrote file to /srv/www/letsencrypt/YKfZ9QrJMgu_iD5bD_GR1h6KPUHSoh3K3VympkbsQuw, but couldn’t download MY_WWW_SITE/.well-known/acme-challenge/YKfZ9QrJMgu_iD5bD_GR1h6KPUHSoh3K3VympkbsQuw”]}
This never happened before with other sites I setup before. The issue seems to be with Let’s Encrypt having issues with generating certificates. I’m using Cloudflare’s free DNS plan and Digital Ocean for hosting.