Don't run ansible tag or role in vagrant provision because of - name: Set root user password errors

I’d like to exclude

{ role: mariadb, tags: [mariadb], when: not mysql_remote_database }

when I run vagrant provision instead of vagrant up, because I get some errors with

- name: Set root user password
- name: Delete anonymous MySQL server users
- name: Remove the test database

Error msg:

msg: unable to connect to database, check login_user and login_password are correct

You can just fix that error from ever happening again. I’m assuming you’re running this on a previously provisioned server?

See these two comments: and

Hi @swalkinshaw

no this a brand new trellis with bedrock - both from the commits last friday

Well can you help us by providing the steps you did? Or any changes/customizations?

  1. I’m assuming you edited some files first?
  2. You ran vagrant up?
  3. Then you tried to run vagrant provision after?

What exact commit of Trellis are you using? What versions of Ansible and Vagrant? Are you using OS X or Windows?

Anything else different you’ve done? We try to help people out but it’s hard when there isn’t much information to go on.

it’s OS X 10.10.5
Ansible 1.9.2

I just edited the wordpress_sites.yml in the dev

# Documentation:
    local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root)
    site_install: true
    site_title: DEV EN
    admin_user: admin
    admin_password: admin
      enabled: true
      subdomains: false
      enabled: true
      enabled: false
      duration: 30s
    system_cron: true
      wp_env: development
      db_charset: utf8mb4
      db_name: usr_p262656_1
      db_user: root
      db_password: devpw

It’s because you’re using root as the db_user which you should not do.

Trellis creates a MySQL user specifically for that WP site database. You should be using something like this:

db_name: local_matrix42
db_user: matrix42
db_password: whatever