Fix permissions after provisioning
Following a full provisioning run there are a couple non-ideal situations:
- Parts of
/home/vagrantare ownedroot:root, which prevents composer from using the oauth token as the vagrant user - Although there's an ACL for
vagranton/var/www/moodle/htdocs, effective permissions wind up being a no-op so you can't reinitialize behat. Apache doesn't need write so owning everythingvagrant:vagrantmight fix it
Hello @mackensen love the vagrantfile here, it has really us here at LSU begin the process of integrating Behat testing into our workflow. Based on my previous experiences using Vagrant (outside of Moodle development), I prefer to sync the main project folder (in this case 'htdocs') with my host machine so that I can use IDEs other than Vim to edit files.
I tried to do this by adding this line within the Vagrantfile:
config.vm.synced_folder "./moodle/", "/var/www/moodle/htdocs", create: true, owner: 'vagrant', :mount_options => ["dmode=777", "fmode=777"]
But when I do this it breaks everything. I'm assuming this is because of permissions errors. I see that you are dealing with a slightly similar situation with this issue you have identified. Do you have any suggestions as to how I can sync the htdocs to my host machine and everything work fine?
Again, thanks for this package, it has really helped speed up behat config.
-Chad
@chadmazilly thanks, I'm glad you find it useful! I've pushed up a5d6585845fa9d2adb9de50df5f590327a020ed3 which seems to resolve the issue (and incorporates the synced folder by default since that's a good idea). Could you give it a try and let me know?
Thanks for the quick response! I'm going to test it out tomorrow and will report back.
Hi @mackensen although that seemed to be a move in the right direction for syncing folders, I am now getting an error when provisioning, specifically at time of execution of the Moodle Behat configuration manifest:
Error: php admin/tool/behat/cli/init.php returned 255 instead of one of [0]
==> default: Error: /Stage[main]/Moodle::Behat/Exec[configure_behat]/returns: change from notrun to 0 failed: php admin/tool/behat/cli/init.php returned 255 instead of one of [0]
After this happens, a number of tasks seem to fail (configure_phpunit, npm stuff, etc.) due to a dependency failure referencing "configure_behat". It does dump you out quickly after with the moodle installation working and accessible.
Are you experiencing the same thing here? I'm going to play around with it for a bit and see if I can help in any way.
Strange; it provisioned cleanly for me. Can you enable the puppet debug mode and re-run the provisioner?