This project is not covered by Drupal’s security advisory policy.
Trigger drush tasks from actions taken on the website!
What? Are we in bizzaro-land here? Normally drush is the tool you use to do things to your Drupal! But what if you wanted Drupal to do something to your drush?
Now you can!
This module provides a new "Drush Task" that is an action that can be triggered by "Rules".
Once it's set up (there can be some glitches, and it may not work on all hosting environments) you can run drush commands when things happen!
The action returns the output of your command, so that can be used for message, logging or diagnostics.
Example
We have an intranet that maintains wiki pages about our many Drupal project sites. When a security update comes around, it's handy to know what sites are on what versions.
I can configure a 'Rule' that runs over all project pages, and uses the information on that page (the site alias) to initiate a 'drush site-status' on each of them, and retain the current state in our notes.
TODO
So far, the drush processes run synchronously, so some of them may cause performance lag. Planned is to use a back-end task-runner to queue some types of task.
The processing and surfacing of feedback from a drush command turned out harder to get into Feeds than I'd expected. Although drush is happy to provide an easily-parsable JSON response, I wasn't able to expose that schema-less structure in a Feeds-compatible way.
TODO: subclass my master "drush task" into smaller, more predictable actions that produce known responses that can be exposed to Rules more easily.
Caveat
This module recommends Bad Judgement.
There are a number of things that can go wrong with this idea, not least of which is security.
It gives your Rules administrators the ability to drush @self sql-drop -y and other arbitrary things like that. But then again, so does arbitrary rules PHP code access.
Project information
- Project categories: Administration tools, Developer tools, Automation
- Created by dman on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.

