Using Ansible for server management and Drush for Drupal maintenance makes for a nice toolbox and in some circumstances I wonder which one to use. Started to think about a Drush module for Ansible, so that everything could be managed from within Ansible utilizing the power of Drush on the remote server(s).
What would be the benefits?
-
Simplified inventory management: Well, yes. Drush can be called locally and initiate tasks on remote server when provided with the right parameters. However, if all that was done through Ansible, the inventory would only have to be maintained for Ansible and not for Drush as well.
-
Better performance: Ansible is really optimized to get connections established and tasks initiated on remote servers including all the permission management and other overhead. Drush does it as well, but Ansible is focusing on this area.
-
Parallel execution: with Ansible as the master, Drush commands could be executed on many hosts at once where Drush is only designed to work in a series.
What would be the functionality?
a) Installing and upgrading Drush
b) Managing inventory and facts:
- Determine Drupal root directories
- Create and maintain alias lists
- Feed all those details back into the facts for Ansible and make them available for subsequent Drush calls
c) Executing Drush commands
What I’m not sure about yet is how we report back to the Ansible host as Drush can be pretty verbose at time and it would be good to get this back to the console of Ansible in a properly readable format.
Anybody around who is interested in such a thing? I’d be keen to invest some time and resources in this project.