Search code examples
wordpressansibleansible-vaultroots-sagetrellis

After changing paswords in vault.yml, deployment fails in trellis


I had a wordpress site setup using Trellis. Initially I had set up the server and deployed without encrypting the vault.yml. Once everything was working fine I changed the passwords in vault.yml and encrypted the file. But my deployment fails now. And I get the following error-

  TASK [deploy : WordPress Installed?] 
 **************************
System info:
Ansible 2.6.3; Darwin
Trellis version (per changelog): "Allow customizing Nginx `worker_connections`"
---------------------------------------------------
non-zero return code

Error: Error establishing a database connection. This either means that 
the username and password information in your `wp-config.php` file is 
incorrect or we can’t contact the database server at `localhost`. This 
could mean your host’s database server is down.

fatal: [mysite.org]: FAILED! => {"changed": false, 
"cmd": ["wp", "core", "is-installed", "--skip-plugins", "--skip- 
themes", "--require=/srv/www/mysite.org/shared/tmp_multisite_constants.php"], "delta": 
"0:00:00.224955", "end": "2019-01-04 16:59:01.531111", 
"failed_when_result": true, "rc": 1, "start": "2019-01-04 
16:59:01.306156", "stderr_lines": ["Error: Error establishing a 
database connection. This either means that the username and password 
information in your `wp-config.php` file is incorrect or we can’t 
contact the database server at `localhost`. This could mean your host’s 
database server is down."], "stdout": "", "stdout_lines": []}
to retry, use: --limit 
@/Users/praneethavelamuri/Desktop/path/to/my/project/trellis/deploy.retry

Is there any step I missed? I followed these steps-

  1. ansible-playbook server.yml -e env=staging
  2. ./bin/deploy.sh staging mysite.org
  3. change passwords in staging/vault.yml
  4. set vault password
  5. inform ansible about password
  6. encrypt the file
  7. commit the file and push the repo
  8. re deploy and then I get the error!

Solution

  • I got it solved. I have changed the sudo user password too in my vault. so ssh into server and changing sudo password to the password mentioned in vault and then provisioning it and then deploying solved the issue.