hashbangcode / vlad

Vlad - Vagrant LAMP Ansible Drupal
173 stars 53 forks source link

Drush 6 Composer Install #285

Closed choicelildice closed 8 years ago

choicelildice commented 8 years ago

Because of this issue: https://github.com/drush-ops/drush/issues/575 with Drush 6, the current build of Vlad fails provisioning if the Drush version is specified to 6.6.0 in the settings variables. I would assume this is the same for all versions of Drush 6, but have not tested that yet. Composer is unable to get the Console_Table library from packagist, as packagist doesn't have the 1.1.3 version. The step the provision fails on is Run drush command to finish setup, which is slightly misleading. Because this step runs Drush for the first time, Drush tries to manage the download and installation of Console_Table itself, and fails because it is not running as Sudo. One workaround would be to run this step as Sudo. I have tested that, and it works. The exact error is:

TASK: [drush | Run drush command to finish setup] ***** failed: [192.168.100.105] => {"changed": true, "cmd": ["/usr/local/bin/drush"], "delta": "0:00:00.058409", "end": "2015-10-13 14:53:22.606996", "rc": 1, "start": "2015-10-13 14:53:22.548587", "stdout_lines": [], "warnings": []} stderr: Drush needs to download a library from [error] http://download.pear.php.net/package/Console_Table-1.1.3.tgz in order to function, and the attempt to download this file automatically failed because you do not have permission to write to the library directory /usr/local/share/drush/lib. To continue you will need to manually download the package from http://download.pear.php.net/package/Console_Table-1.1.3.tgz, extract it, and copy the directory into your /usr/local/share/drush/lib directory.

The workaround would be to change add "sudo: true" after the "Run drush command to finish setup" task in the main.yml file in vlad_guts/playbooks/roles/drush/tasks folder. I did not supply this fix as a pull request, as I feel it is more of a temporary work around than a solution to the actual issue.

dixhuit commented 8 years ago

Bumped into this yesterday and was planning to raise it - thanks for doing the leg work!

dixhuit commented 8 years ago

Shall we add the sudo workaround as a hotfix to master for now? @philipnorton42

philipnorton42 commented 8 years ago

Thanks for posting this (as well as suggesting the fix). I don't think this is a temporary work around, especially as the sudo permission would allow the ansible user to put the right files in the right places.

In terms of versioning I don't mind rolling a new version if we need to. There are a couple of very minor changes pending so it makes sense.

dixhuit commented 8 years ago

Fixed in dev branch by adding sudo as discussed.

Thanks again @choicelildice.