I just tried to build out a box running… ansible-playbook server.yml -e env=production as I had done dozens + times… I run into the following issue…
one clue is that in the error there’s a linebreak between “my” and “site.com.key” on the line after the non-zero return code in the stacktrace.
RUNNING HANDLER [common : reload nginx] *****************************************************************************************************
System info:
Ansible 2.4.0.0; Darwin
Trellis 1.0.0: December 27th, 2018
---------------------------------------------------
non-zero return code
nginx: [emerg] SSL_CTX_use_PrivateKey_file("/etc/nginx/ssl/letsencrypt/my
site.com.key") failed (SSL: error:0B080074:x509 certificate
routines:X509_check_private_key:key values mismatch)
nginx: configuration file /etc/nginx/nginx.conf test failed
fatal: [mysite.com]: FAILED! => {"changed": true, "cmd": ["nginx", "-t"], "delta": "0:00:00.017923", "end": "2019-01-08 17:02:05.287841", "failed": true, "rc": 1, "start": "2019-01-08 17:02:05.269918", "stderr_lines": ["nginx: [emerg] SSL_CTX_use_PrivateKey_file(\"/etc/nginx/ssl/letsencrypt/mysite.com.key\") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)", "nginx: configuration file /etc/nginx/nginx.conf test failed"], "stdout": "", "stdout_lines": []}
Any idea what the issue is?
Edit: this is on a fresh 18.04 box on digitalocean
Edit2: my wordpress-sites.yml has letsencrypt set to true.
when I hit mysite.com with https i get an issue that the server is not listening on 443, when i hit it with http I get the welcome to nginx screen
Edit3: just rebuilt the sever, set
ssl:
enabled: false
it provisions and deploys fine, going to try setting ssl to enabled: true and run
ansible-playbook server.yml -e env=production --tags "letsencrypt"
edit4:
same result as provisioning with ssl enabled true
RUNNING HANDLER [common : reload nginx] ***************************************************************************************************
System info:
Ansible 2.4.0.0; Darwin
Trellis 1.0.0: December 27th, 2018
---------------------------------------------------
non-zero return code
nginx: [emerg] SSL_CTX_use_PrivateKey_file("/etc/nginx/ssl/letsencrypt/my
site.com.key") failed (SSL: error:0B080074:x509 certificate
routines:X509_check_private_key:key values mismatch)
nginx: configuration file /etc/nginx/nginx.conf test failed
fatal: [mysite.com]: FAILED! => {"changed": true, "cmd": ["nginx", "-t"], "delta": "0:00:00.014845", "end": "2019-01-08 17:33:21.582023", "failed": true, "rc": 1, "start": "2019-01-08 17:33:21.567178", "stderr_lines": ["nginx: [emerg] SSL_CTX_use_PrivateKey_file(\"/etc/nginx/ssl/letsencrypt/mysite.com.key\") failed (SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch)", "nginx: configuration file /etc/nginx/nginx.conf test failed"], "stdout": "", "stdout_lines": []}