the roots-example-project repo is what the end goal should look like if you choose to use bedrock and deploy with ansible. If you clone the example you get the entire setup without going through all the steps that the readme now provides. If you follow the steps you learn the process top to bottom, if you use the roots-example-project you pretty much bypass them but end up at the same result…just less understanding of how you got there
If you do use the roots-example-project the following worked for me
clone it into whatever project folder you are working from
BEFORE you run vagrant up make sure you edit ansible\group_vars\development and have you dev url in there. Edit between site_hosts and php_error_reporting
Run vagrant up from your project root where the vagrantfile sits
Start working.
Have some tea, post a thank you to @swalkinshaw and the rest of the team for being so amazing!
That worked for me
Ran through it twice already with other projects, not just using the example domain.
true, I think the roots-example-project has already adjusted the path so I skipped that step. That also illustrates what happens when you use roots-example-project without going through the documentation from start to finish, you end up not knowing what settings are actually needed to be adjusted.
I haven’t gotten to deploying with Ansible yet so my steps reflect getting the site up and running if you clone the roots-example-project.
This is excellent, when you’re self-teaching, examples are invaluable.
One thing I’d like to see added to the readme is the DO droplet you recommend using. I was stuck for a while during setup of my production server when Mariadb kept being unable to set the db’s root password. Finally, I spun up a premade LEMP droplet and everything worked just fine. (now I’m stuck at deployment, but I’ll get there eventually.)
@evanfuture, I got stuck at the same (TASK: [mariadb | Set root user password] Operation CREATE USER failed for 'root') and was just about to troubleshoot it when I saw your comment. I might spin up a LEMP server now to see if that gets me by… although Ansible should normally handle this.
@evanfuture I solved this by deleting the root user with the password problem. The error was that the root user was already created, so it failed at this step. I SSH’ed into my droplet, then:
SELECT user, host, password FROM mysql.user; DROP USER 'root'@'mydropletname';
Re-ran the ansible playbook and it continued past this step.
They acknowledged it’s probably a bug. It happens (at least in our cases) when the playbook is re-run. I posted a GitHub issue here. Running drop user is a workaround in the meantime.
My first time working with roots tools and I got your Modern Wordpress Example example working locally as is, but haven’t had success yet when going through the whole process from start to finish as outlined in the readme. Various errors pop up - usually when installing some of the requirements.
One in particular: I’m having a bit of a problem in the scenario of starting a different project folder besides the first folder I started in. The error occurs when running ‘vagrant up’ at the point where it tries exporting NFS shared folders. The error says they are non-existant because it is looking for them in the path of the previous projects folder.
Do I need to manually change a line in Vagrantfile? Do I need to uninstall/reinstall vagrant-bindfs?
Working now - reload/destroy didn’t work but reinstalling bindfs did and that makes me think I originally installed it in the wrong place.
That and fixing a couple of other things I did wrong and I’ve got my local dev all up and running! I’m definitely the “If I can do it anybody can” guy.
I’m trying to set up local instance of roots-example-project. My environment is macOS, homebrew, virtualbox.
When doing vagrant up for the first time there were some errors related to logrotate component, however VM starts OK, vagrant ssh works just fine.
When I check /etc/nginx/nginx.conf, I see that does include sites-enables/* (which is expected), however in sites-enabled I’m seeing only no-default.conf - which is configured to immediately return 444, and no traces of references to WP installation (which is as I understand is under /srv/www/…)
Am I missing something?
Thanks for great work, I’m looking for development environment for WP, and Roots stack looks excellent (or rather amazing I would say), it’s just learning curve seems quite steep for me.
If you got an error it might mean not everything ran. Can you try running vagrant provision again? Or destroy it and re-up. Seeing the error messages would help.
I’m getting this error (tried to destroy VM and re-up again, problem reproduced):
TASK [logrotate : nickhammond.logrotate | Install logrotate] *******************
ok: [default]
TASK [logrotate : nickhammond.logrotate | Setup logrotate.d scripts] ***********
System info:
Ansible 2.2.2.0; Vagrant 1.9.3; Darwin
Trellis at "WP 4.6 Compat: set WP_HOME/SITEURL directly"
---------------------------------------------------
the field 'args' has an invalid value, which appears to include a variable
that is undefined. The error was:
'ansible.vars.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'name'
The error appears to have been in '/Users/vegorov/roots.io/roots-example-
project.com/trellis/vendor/roles/logrotate/tasks/main.yml': line 5, column 3,
but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
- name: nickhammond.logrotate | Setup logrotate.d scripts
^ here
fatal: [default]: FAILED! => {"failed": true}
RUNNING HANDLER [common : restart memcached] ***********************************
changed: [default]
and finally:
PLAY RECAP *********************************************************************
default : ok=72 changed=58 unreachable=0 failed=1
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
VM goes up, I can ssh to it, nginx and mysql are running.
On a diffenet note - I’ve noticed also that php7.0-fpm is not running: systemctl status php7.0-fpm.service tells that it’s failed, in tail /var/log/php7.0-fpm.log I’m seeing "No pool defined"error - but again, it may be because both issues have same root cause.
Tried vagrant provision and got php-fpm related error:
TASK [php : Start php7.0-fpm service] ******************************************
System info:
Ansible 2.2.2.0; Vagrant 1.9.3; Darwin
Trellis at "WP 4.6 Compat: set WP_HOME/SITEURL directly"
---------------------------------------------------
Unable to start service php7.0-fpm: Job for php7.0-fpm.service failed because
the control process exited with error code. See "systemctl status
php7.0-fpm.service" and "journalctl -xe" for details.
fatal: [default]: FAILED! => {"changed": false, "failed": true}
to retry, use: --limit @/Users/vegorov/roots.io/roots-example-project.com/trellis/dev.retry
PLAY RECAP *********************************************************************
default : ok=43 changed=2 unreachable=0 failed=1
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
@vegorov When I search discourse for the logrotate error you posted…
Regarding your version of Trellis at "WP 4.6 Compat: set WP_HOME/SITEURL directly", it looks like it is probably from Sept 2016. You may want to update your Trellis, which would likely also prevent the no pool defined error.
I’m finally figured out what was wrong - I’ve git-cloned example project repository instead of cloning trellis and bedrock from corresponding repos. Example repo has trellis and bedrock installations, but not latest, obviously.
Newly created project with up to date trellis and bedrock provisioned successfully and all runs as expected.
A lot of stuff is very new to me - I’m kinda in copy-paste mode with regard to stuff like ansible, npm, yarn, etc etc, but it’s a different story.
I’ve installed (seemingly) sage and built it, so I’ve reached good starting point.