First of all, what a fantastic set of products you have produced. Thank you so much for your efforts!
Now, I am attempting to perform the wordpress installation automatically on my staging site but its just not happening. Is this even possible or do i need to tweak the deploy playbook somehow? Everything else is being deployed perfectly. Here’s what my staging group_vars looks like:
wordpress_sites:
example.com:
site_hosts:
- staging.example.com
local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root)
repo: git@bitbucket.org:un_titled/wordpress-experimental-boilerplate.git
branch: master
subtree: site # Use this if following the roots-example-project structure
site_install: true
site_title: Example Site
admin_user: admin
admin_password: admin
admin_email: admin@example.dev
.
.
.
.
Sorry if I didnt explain correctly. I am not receiving any errors, everything is working fine. The issue I am having is that on initial deployment to my staging server I would like it if wordpress were installed automatically as part of the deploy. I thought defining site_install: true in my group_vars would do that. However, its seems the wordpress-install role isn’t even being fired off.
I think this will attempt a composer install but the staging/production server won’t yet have a composer.json or bedrock project ready to receive install, so it will fail. The dev vagrant vm has a composer.json because of the vagrant synced folders.
Also, if there is a wp install in web root, deploy.yml will fail. I guess one of it’s checks is that current is a symlink.
TASK: [deploy | Initialize] ***************************************************
failed: [104.131.190.246] => {"failed": true}
msg: /srv/www/example.com/current exists but is not a symbolic link
So, my first attempt at automating an install would probably not be to use the wordpress-install role. Instead, I’d add these vars to group_vars/staging and a command like this:
project_post_finalize_commands:
+ - if ! wp core is-installed; then wp core install --url="{{ project.env.wp_home }}" --title="{{project.site_title }}" --admin_user="{{ project.admin_user }}" --admin_password="{{ project.admin_password }}" --admin_email="{{ project.admin_email }}"; fi
- sudo service php5-fpm reload