Changed site name in `wordpress_sites.yml`, cannot provision

After changing the site name in wordpress_sites.yml, then running vagrant provision, I get following error, apparently not re-creating the composer.json file in the srv folder. Not sure how to get ansible to re-run the site srv and composer provision (unless I have to initialize composer manually?)

System info:
  Ansible 2.7.9; Vagrant 2.2.4; Darwin
  Trellis 1.0.2: March 13th, 2019
---------------------------------------------------
Composer could not find a composer.json file in
/srv/www/chargers.org/current To initialize a project, please create a
composer.json file as described in the https://getcomposer.org/ "Getting
Started" section
failed: [default] (item=chargers.org) => {"changed": false, "item": {"key": "chargers.org", "value": {"admin_email": "admin@chargers.test", "cache": {"enabled": false}, "local_path": "../site", "multisite": {"enabled": false}, "site_hosts": [{"canonical": "chargers.test", "redirects": ["www.chargers.test"]}], "ssl": {"enabled": true, "provider": "self-signed"}}}, "stdout": "Composer could not find a composer.json file in /srv/www/chargers.org/current\nTo initialize a project, please create a composer.json file as described in the https://getcomposer.org/ \"Getting Started\" section\n", "stdout_lines": ["Composer could not find a composer.json file in /srv/www/chargers.org/current", "To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ \"Getting Started\" section"]}
  • Updated hostmanager plugin with vagrant plugin update
  • ssh into vm and delete the /srv/www/OLDNAME.ORG, (CHARGERS.ORG was also there, but without correct current/composer.json)
  • vagrant reload
  • vagrant provision

Now /srv/www/CHARGERS.ORG/current/composer.json and toerh files are there, but nginx will not start:

System info:
  Ansible 2.7.9; Vagrant 2.2.4; Darwin
  Trellis 1.0.2: March 13th, 2019
---------------------------------------------------
Job for nginx.service failed because the control process exited with error
code.
See "systemctl status nginx.service" and "journalctl -xe" for details.

fatal: [default]: FAILED! => {"changed": false}
	to retry, use: --limit @/Users/mcheck/proj/chargers.org/trellis/dev.retry

Reviewing the error in the community, I found this: Provisioning Error + Nginx Config Test Failed

That led me to think the journaling was linking to the first sitename/folder.

So this worked:

$ vagrant ssh
vagrant$ sudo apt-get remote nginx nginx-common # removes all but configs
vagrant$ sudo apt-get purge nginx nginx-common # removes everything
vagrant$ sudo apt-get autoupdate # removes anything else related
vagrant$ exit
$ vagrant provision

Nginx reprovisions nginx and it starts up perfectly. YeeeHaw!

This topic was automatically closed after 42 days. New replies are no longer allowed.