|
1 ## Drush puppet module |
|
2 |
|
3 [](http://forge.puppetlabs.com/jonhattan/drush) [](https://github.com/jonhattan/puppet-drush/tags) |
|
4 |
|
5 This module enables installing several versions of [Drush](http://www.drush.org/) system-wide. |
|
6 |
|
7 At present the available installation method is via [Composer](https://getcomposer.org/). |
|
8 |
|
9 |
|
10 ## Quick install instructions |
|
11 |
|
12 Find quick install instructions in the [Puppetry for Drupaleros](https://github.com/jonhattan/puppet-drush/wiki/Puppetry-for-Drupaleros) |
|
13 wiki page. |
|
14 |
|
15 These instructions are intended for people that don't have the time or the |
|
16 need to learn Puppet, but wants to benefit from the facilities provided by |
|
17 this Puppet module in order to install and manage several versions of Drush |
|
18 system-wide. |
|
19 |
|
20 |
|
21 ## Features |
|
22 |
|
23 * Installs dist (tarball) or source code (git clone) of Drush |
|
24 * Definition of Drush aliases |
|
25 * Download Drush extensions |
|
26 * Optionally install command dependencies (wget, git, gzip, rsync, ...) |
|
27 * Configures bash integration. Only autocompletion or full integration |
|
28 * Allows to choose the 'default' Drush installation |
|
29 |
|
30 It doesn't goes crazy to provide a freaking interface to run Drush commands |
|
31 from Puppet. Although it is tempting, and I don't discard that in a future, |
|
32 it doesn't seem suitable in Puppet philosophy. |
|
33 |
|
34 |
|
35 ## What it does |
|
36 |
|
37 Each given Drush version is installed to a directory matching its major |
|
38 version under `/opt/drush/`. Also, a symlink to the executable is placed |
|
39 in `/usr/local/bin/`, suffixed with its major version. |
|
40 |
|
41 Additionally, for the default version, `/opt/drush/default` will be a symlink |
|
42 to its codebase, and `/usr/local/bin/drush` will point to its executable. |
|
43 |
|
44 For example if you choose to install Drush versions `6` and `master`, being |
|
45 `6` the chosen default version, this is the final result on the filesystem: |
|
46 |
|
47 ``` |
|
48 d /opt/drush/master |
|
49 d /opt/drush/6 |
|
50 l /opt/drush/default -> /opt/drush/6/vendor/drush/drush |
|
51 d /opt/drush/.composer |
|
52 |
|
53 l /usr/local/bin/drush -> /usr/local/bin/drush6 |
|
54 l /usr/local/bin/drush6 -> /opt/drush/6/vendor/bin/drush |
|
55 l /usr/local/bin/drushmaster -> /opt/drush/master/vendor/bin/drush |
|
56 ``` |
|
57 |
|
58 With respect to other artifacts, |
|
59 |
|
60 * Aliases are installed to `/etc/drush` |
|
61 * Extensions are downloaded to `/usr/share/drush/commands`, the standard Drush |
|
62 site-wide location |
|
63 * Several shell scripts may be placed in `/etc/bash_completion.d` and |
|
64 `/etc/profile.d`, depending on the provided arguments to Drush class. |
|
65 |
|
66 |
|
67 ## Example usage |
|
68 |
|
69 Below is an example of the supported Hiera data structure. |
|
70 |
|
71 See [Puppetry for Drupaleros](https://github.com/jonhattan/puppet-drush/wiki/Puppetry-for-Drupaleros) |
|
72 wiki page for an example of Puppet code not based on Hiera. |
|
73 |
|
74 ### Hieradata |
|
75 |
|
76 ```yaml |
|
77 classes : |
|
78 - 'drush' |
|
79 |
|
80 drush::versions : |
|
81 - '6' |
|
82 - 'master' |
|
83 |
|
84 drush::extensions : |
|
85 - 'drush_extras' |
|
86 - 'registry_rebuild' |
|
87 |
|
88 drush::aliases : |
|
89 base: |
|
90 group : 'example' |
|
91 path_aliases : |
|
92 '%dump-dir' : '/opt/dumps' |
|
93 command_specific : |
|
94 sql-sync : |
|
95 cache: false |
|
96 |
|
97 dev : |
|
98 group : 'example' |
|
99 parent : '@base' |
|
100 root : '/var/www/dev.example.com/htdocs' |
|
101 uri : 'dev.example.com' |
|
102 |
|
103 staging : |
|
104 group : 'example' |
|
105 parent : '@base' |
|
106 root : '/var/www/staging.example.com/htdocs' |
|
107 uri : 'staging.example.com' |
|
108 remote_host : 'staging.example.com' |
|
109 remote_user : 'deploy' |
|
110 ssh_options : '-p 2203' |
|
111 |
|
112 ``` |
|
113 |
|
114 |
|
115 ### Manifest |
|
116 |
|
117 ```ruby |
|
118 |
|
119 # Include the declared Hiera classes and let Puppet do the magic. |
|
120 hiera_include('classes') |
|
121 ``` |
|
122 |
|
123 ## License |
|
124 |
|
125 MIT |
|
126 |
|
127 |
|
128 ## Author Information |
|
129 |
|
130 Jonathan AraƱa Cruz - SB IT Media, S.L. |
|
131 |