Trellis / Site passwords not syncin

I have a fresh Trellis installation on Windows. When I run vagrant up --provision from Windows cli, script fails when it tries to connect to mariadb. “Access denied for user
’kapa51’@‘localhost’ (using password: YES) in /srv/www/kapa51/current/web/wp
/wp-includes/wp-db.php on line 1538”.

my sites .env shows that DB_PASSWORD does not match what I have set in trellis config:
.env:

DB_PASSWORD='Null'

I can connect to mysql when I SSH into vagrant and connect to database with user kapa51 without any password.

wordpress_sites.yml

 wordpress_sites:
   kapa51:
     site_hosts:
       - canonical: kapa51.dev
         redirects:
           - www.kapa51.dev
     local_path: ../kapa51 # path targeting local Bedrock site directory (relative to Ansible root)
     admin_email: xxx@xxx.com
     multisite:
       enabled: false
     ssl:
       enabled: false
       provider: self-signed
     cache:
       enabled: false

vault.yml:

vault_mysql_root_password: devpw

vault_wordpress_sites:
  kapa51:
    admin_password: admin
    env:
      db_password: 123

Is there something wrong with my config? I read the docs, but what I understood, these two files should be the only ones that needs to be modified for my local development environment to work.

1 Like

@MasonFI Thanks for pointing this out!

Unfortunately it appears that when Ansible hands off the db_password integer value 123 to the Trellis to_env filter’s dict_value, it comes out as the python value None. Perhaps Trellis could detect such a scenario and output a help message:

:star: Numeric values in env vars in wordpress_sites and vault_wordpress_sites must be wrapped in quotes:
db_password: '123'

Try making that change then run the last portion of your dev.yml playbook:
ANSIBLE_TAGS=wordpress vagrant provision

1 Like

Thanks its working now!

Btw if you have to run that command from Windows CLI, use this:

cmd /V /C “set ANSIBLE_TAGS=wordpress&& vagrant provision”

1 Like

:sunny: Fixed in roots/trellis#959