Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TASK [wordpress-setup : Create database of sites] goes wrong #587

Closed
iduuck opened this issue May 22, 2016 · 10 comments
Closed

TASK [wordpress-setup : Create database of sites] goes wrong #587

iduuck opened this issue May 22, 2016 · 10 comments

Comments

@iduuck
Copy link

iduuck commented May 22, 2016

Bug report

Command:

ansible-playbook server.yml -e env=staging

Log:

TASK [wordpress-setup : Create database of sites] ******************************
System info:
  Ansible 2.0.2.0; Darwin
  Trellis at "Require Ansible 2.0.2 and remove deploy_helper"
---------------------------------------------------
The conditional check 'site_uses_local_db and item.value.db_create |
default(True)' failed. The error was: error while evaluating conditional
(site_uses_local_db and item.value.db_create | default(True)): 'dict object'
has no attribute u'theluxuryjournal.com'

The error appears to have been in
'/Users/nick/Development/theluxuryjournal.com/trellis/roles/wordpress-
setup/tasks/database.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

---
- name: Create database of sites
  ^ here

fatal: [188.166.160.141]: FAILED! => {"failed": true}
    to retry, use: --limit @server.retry

Please describe your local environment:

Ansible version: ansible 2.0.2.0

OS: 10.10

Vagrant version: Vagrant 1.8.1

Where did the bug happen? Development or remote servers?

Remote server

Please provide a repository or your wordpress_sites config (if possible):

# Documentation: https://roots.io/trellis/docs/remote-server-setup/
# `wordpress_sites` options: https://roots.io/trellis/docs/wordpress-sites
# Define accompanying passwords/secrets in group_vars/staging/vault.yml

wordpress_sites:
  theluxuryjournal.com:
    site_hosts:
      - staging.theluxuryjournal.com
    local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root)
    repo: GIT-REPO-HERE # replace with your Git repo URL
    repo_subtree_path: site # relative path to your Bedrock/WP directory in your repo
    branch: staging
    multisite:
      enabled: false
    ssl:
      enabled: true
      provider: letsencrypt
    cache:
      enabled: false
@iduuck
Copy link
Author

iduuck commented May 22, 2016

Done! Forgot to add theluxuryjournal.com to the vault config.

@iduuck iduuck closed this as completed May 22, 2016
@jerome-toole
Copy link

thanks @iduuck exactly my mistake 🐰

@corysimmons
Copy link

Same. There are a lot of places to remember to put this before provisioning for 10 minutes.

Roots Team: It might be a good idea to test for these values to sync up before running the other provisioners. /shrug

@jerome-toole
Copy link

I think that's a good idea. I've actually done this a couple of times since. 🤦‍♂️

@jasperf
Copy link

jasperf commented Jan 22, 2017

It would be good, but I do not have enough Ansible knowledge yet to know whether it would be hard to check for example that you forget to replace the example domain. Would be great to suggest in the error message that that might be at. But yeah, would be even greater to check whether there are any leftover example.coms. One thing I can see being an issue though is that I do not always use staging and that you would probably need to check all files loaded example.com data and in my case it would then stop as I did not change anything in the staging folder.

@sw33tr
Copy link

sw33tr commented Jan 29, 2017

yep, happened to me as well 🥇

@ajithrn
Copy link

ajithrn commented Mar 30, 2017

it happened to me as well and it took too long to fix it too :(

@s3w47m88
Copy link

s3w47m88 commented Apr 7, 2017

I experienced this as well. Thank you for creating the thread.

I would be willing to submit a patch for this but I'm brand new to Trellis / Bedrock / Sage. So I'll add this to a list of things I want to revisit in coming weeks as I learn my way around a bit more and then try to take a stab at this if no one else has by then.

@apmarshall
Copy link

Had this happen as well, and after checking (and re-checking) that had the domain right everywhere, variables correct, no spelling mistakes, etc, still couldn't get to work. I'm an emacs user, and finally realized that when I first edited wordpress_sites.yml, emacs was creating a wordpress_sites.yml~ temporary file. The presence of this extra file, which didn't have the right domain name/variables in it, was throwing Ansible off, removing it fixed the problem right away. So if any other emacs users are struggling with this particular issue, hopefully this will save you some time and frustration. Not sure if there's a way to make Ansible be able to tell the difference between the two files and always choose the right one, but someday I'll get around to looking into that.

@swalkinshaw
Copy link
Member

I just added a validation to catch when the vault config hasn't been updated to match wordpress sites: #823

So people shouldn't run into this specific error anymore.

@roots roots locked and limited conversation to collaborators Apr 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants