Some time ago, at the Barcamp in Mainz, I had the pleasure of receiving a great introduction to Puppet and Vagrant from Stefan Husch, who has been developing in Ruby for several years, and my former colleague Mattias Gutjahr. Since then, I have been looking into the whole "DevOps" topic from time to time and trying to automate things I have to do repeatedly. Stefan is quite a bit ahead of me here. He has been provisioning his servers with Puppet for years and, for example, spins up instances of his CMS or Redmine at the push of a button. Since I was immediately interested in the topic in connection with Magento back then, I made my initial experiences publicly available through a Github project. I also showed it at the time as part of a short presentation at our PHPUG. As mentioned, the project contained my first experiences with Puppet and Vagrant. But I am still surprised from time to time when someone forks the project, even though the scripts are far from optimal. Some forks (e.g. https://github.com/matthewsplant/magento-vagrant-puppet) have taken the project quite a bit further. That naturally makes me happy.
New Project with Nginx
I have now put a new version online. Unlike the first variant, I now rely on several standard modules that are easy to find in the central repository at https://forge.puppetlabs.com/. The modules are organized in their own Git repositories, which I simply included as Git submodules. The Vagrant box is based on the current official Ubuntu Precise 64-bit box, which Vagrant downloads once if needed.
The project can quickly be set up through the console as follows:
git clone https://github.com/cmuench/Magento-Vagrant-Puppet-Nginx.git
cd Magento-Vagrant-Puppet-Nginx
git submodule init
git submodule update
vagrant up
After the Vagrant box starts, all dependencies are installed directly through Puppet. Specifically, these are the following server components:
Adjustments
All other Puppet modules are called through the base Puppet module named "magento". The module currently provides several parameters that can be used, for example, to set the Magento version. If you want to install Magento yourself, simply set the "install_magento" parameter to "false". In that case, only the environment is installed, but not the shop. This is useful for testing Magento Enterprise Editions, for example, because they cannot and may not be downloaded through n98-magerun without adjusting the configuration.
The adjustment is made in the file puppet/manifests/base.pp.
class { "magento":
install_magento => true,
magento_version => "magento-ce-1.6.2.0",
install_sample_data => true
}
The following Magento versions are valid values:
- magento-ce-1.6.2.0
- magento-ce-1.7.0.2
- mageplus-master
- magento-mirror-1.4.2.0
- magento-mirror-1.5.1.0
- magento-mirror-1.6.2.0
- magento-ce-2.0.0.0-dev
I will certainly be doing some more tinkering with this project. I look forward to your feedback.