使用带有Maven和Tomcat食谱的vagrant-berkshelf,我可以指定要安装的主要版本。
Using vagrant-berkshelf with the Maven and Tomcat cookbooks, I can specify a major version to install.
示例:Maven-2或3个 Tomcat -5或6
Example: Maven - 2 or 3 Tomcat - 5 or 6
如果我想指定库的确切版本(Maven 3.2.1),是否应该使用Ark Cookbook安装所需的版本?
If I want to specify an exact version of a library (Maven 3.2.1), should I just use the Ark Cookbook to install the desired version?
DevOps经验有限,我习惯使用 yum 或 apt -get 来管理我的库,而无需指定特定版本。
Having limited DevOps experience, I'm used to making use of yum or apt-get to manage my libraries without specifying a particular version.
推荐答案Maven食谱已经使用了方舟。因此,您可以覆盖以下节点属性:
The Maven cookbook already uses ark. So you could just override the following node attributes:
node['maven']['version'] = 3 node['maven']['3']['version'] = '3.2.1' node['maven']['3']['url'] = ??? node['maven']['3']['checksum'] = ???tomcat食谱会安装软件包,因此您需要使用ark或构建一个Deb / RPM软件包。
The tomcat cookbook on the other hand does a package install, so you'd need to use ark or build a Deb/RPM package.
使用ark来安装tomcat的唯一缺点是您将没有服务脚本来管理tomcat的停止/启动/状态。
The only downside to using ark for tomcat is that you won't have service scripts to manage tomcat's stop/start/status. Some extra work would be needed.
以下是一个无所事事的项目,安装了Maven 3.2.1。
The following is a vagrant project that installs Maven 3.2.1
├── Berksfile └── VagrantfileVagrantfile
Vagrantfile
Vagrant.require_plugin "vagrant-omnibus" Vagrant.require_plugin "vagrant-berkshelf" Vagrant.require_plugin "vagrant-chef-zero" VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| # Box config config.vm.box = "saucy64" config.vm.box_url = "cloud-images.ubuntu/vagrant/saucy/current/saucy-server-cloudimg-amd64-vagrant-disk1.box" # Virtualbox config config.vm.provider :virtualbox do |vb| vb.customize ["modifyvm", :id, "--memory", 4096] end # Networking config config.vmwork "private_network", ip: "10.0.0.10" # Plugin config config.omnibus.chef_version = :latest config.chef_zero.enabled = true config.berkshelf.enabled = true # Chef config config.vm.provision :chef_client do |chef| chef.add_recipe "apt" chef.add_recipe "maven" chef.json = { 'maven' => { 'version' => 3, '3' => { 'version' => '3.2.1', 'url' => 'www.eu.apache/dist/maven/maven-3/3.2.1/binaries/apache-maven-3.2.1-bin.tar.gz', 'checksum' => 'cdee2fd50b2b4e34e2d67d01ab2018b051542ee759c07354dd7aed6f4f71675c' } } } end endBerksfile
Berksfile
site :opscode cookbook 'apt' cookbook 'maven'更多推荐
安装特定库版本
发布评论