Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x
- Puppet >= 5.5.0 < 9.0.0
- , ,
Start using this module
Add this module to your Puppetfile:
mod 'jonhattan-drush', '0.7.0'
Learn more about managing modules with a PuppetfileDocumentation
Drush puppet module
This module enables installing several versions of Drush system-wide.
At present the available installation method is via Composer.
Quick install instructions
Find quick install instructions in the Puppetry for Drupaleros wiki page.
These instructions are intended for people that don't have the time or the need to learn Puppet, but wants to benefit from the facilities provided by this Puppet module in order to install and manage several versions of Drush system-wide.
Features
- Installs dist (tarball) or source code (git clone) of Drush
- Definition of Drush aliases
- Download Drush extensions
- Optionally install command dependencies (wget, git, gzip, rsync, ...)
- Configures bash integration. Only autocompletion or full integration
- Allows to choose the 'default' Drush installation
It doesn't goes crazy to provide a freaking interface to run Drush commands from Puppet. Although it is tempting, and I don't discard that in a future, it doesn't seem suitable in Puppet philosophy.
What it does
Each given Drush version is installed to a directory matching its major
version under /opt/drush/
. Also, a symlink to the executable is placed
in /usr/local/bin/
, suffixed with its major version.
Additionally, for the default version, /opt/drush/default
will be a symlink
to its codebase, and /usr/local/bin/drush
will point to its executable.
For example if you choose to install Drush versions 6
and master
, being
6
the chosen default version, this is the final result on the filesystem:
d /opt/drush/master
d /opt/drush/6
l /opt/drush/default -> /opt/drush/6/vendor/drush/drush
d /opt/drush/.composer
l /usr/local/bin/drush -> /usr/local/bin/drush6
l /usr/local/bin/drush6 -> /opt/drush/6/vendor/bin/drush
l /usr/local/bin/drushmaster -> /opt/drush/master/vendor/bin/drush
With respect to other artifacts,
- Aliases are installed to
/etc/drush
- Extensions are downloaded to
/usr/share/drush/commands
, the standard Drush site-wide location - Several shell scripts may be placed in
/etc/bash_completion.d
and/etc/profile.d
, depending on the provided arguments to Drush class.
Example usage
Below is an example of the supported Hiera data structure.
See Puppetry for Drupaleros wiki page for an example of Puppet code not based on Hiera.
Hieradata
classes :
- 'drush'
drush::versions :
- '6'
- 'master'
drush::extensions :
- 'drush_extras'
- 'registry_rebuild'
drush::aliases :
base:
group : 'example'
path_aliases :
'%dump-dir' : '/opt/dumps'
command_specific :
sql-sync :
cache: false
dev :
group : 'example'
parent : '@base'
root : '/var/www/dev.example.com/htdocs'
uri : 'dev.example.com'
staging :
group : 'example'
parent : '@base'
root : '/var/www/staging.example.com/htdocs'
uri : 'staging.example.com'
remote_host : 'staging.example.com'
remote_user : 'deploy'
ssh_options : '-p 2203'
Manifest
# Include the declared Hiera classes and let Puppet do the magic.
hiera_include('classes')
License
MIT
Author Information
Jonathan Araña Cruz - SB IT Media, S.L.
Changelog
0.7.0 (2024-05-19)
Closed issues:
Merged pull requests:
- Add Puppet8x support #19 (flepoutre)
- Purge unmanaged files from /etc/drush/sites #17 (KrisMagjistari)
- Use Puppet datatypes (5.5.0+) instead of the deprecated validate_*() functions #16 (smokris)
0.6.1 (2020-09-28)
0.6.0 (2020-07-01)
Merged pull requests:
- Add support for Drush 9 #12 (jonhattan)
- Support newer versions of concat #7 (bhamilton)
- split name to get folder name if using specific extension versions #6 (timhammond)
0.5.0 (2015-06-29)
Closed issues:
- Duplicate declarations for Package[wget] #5
0.4.0 (2014-12-18)
Merged pull requests:
0.3.0 (2014-10-22)
Closed issues:
- Weird dir created #3
0.2.0 (2014-09-19)
Closed issues:
- Ensure extra "required" packages #1
0.1.0 (2014-08-03)
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/stdlib (>= 4.14.0 < 10.0.0)
- puppetlabs/concat (>= 1.2.1 < 7.0.0)