| author | ymh <ymh.work@gmail.com> |
| Fri, 28 Feb 2014 09:55:12 +0100 | |
| changeset 588 | 8e9ea314e06e |
| parent 587 | a1aa29e7809f |
| child 590 | e103299bccc0 |
| permissions | -rw-r--r-- |
|
587
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
# -*- mode: ruby -*- |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
# vi: set ft=ruby : |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
3 |
|
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
4 |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
5 |
VAGRANTFILE_API_VERSION = "2" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
|
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
# All Vagrant configuration is done here. The most common configuration |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
# options are documented and commented below. For a complete reference, |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
10 |
# please see the online documentation at vagrantup.com. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
11 |
|
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
12 |
# Every Vagrant virtual environment requires a box to build off of. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
13 |
config.vm.box = "wheezy-73-x64" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
14 |
|
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
15 |
# The url from where the 'config.vm.box' box will be fetched if it |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
16 |
# doesn't already exist on the user's system. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
17 |
config.vm.box_url = "http://puppet-vagrant-boxes.puppetlabs.com/debian-73-x64-virtualbox-puppet.box" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
18 |
|
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
19 |
# Create a forwarded port mapping which allows access to a specific port |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
20 |
# within the machine from a port on the host machine. In the example below, |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
21 |
# accessing "localhost:8080" will access port 80 on the guest machine. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
22 |
# config.vm.network :forwarded_port, guest: 80, host: 8080 |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
23 |
|
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
24 |
# Create a private network, which allows host-only access to the machine |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
25 |
# using a specific IP. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
26 |
config.vm.network :private_network, ip: "172.16.1.2" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
27 |
|
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
28 |
# Create a public network, which generally matched to bridged network. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
29 |
# Bridged networks make the machine appear as another physical device on |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
30 |
# your network. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
31 |
# config.vm.network :public_network |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
32 |
|
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
33 |
# If true, then any SSH connections made will enable agent forwarding. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
34 |
# Default value: false |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
35 |
# config.ssh.forward_agent = true |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
36 |
|
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
37 |
# Share an additional folder to the guest VM. The first argument is |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
38 |
# the path on the host to the actual folder. The second argument is |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
39 |
# the path on the guest to mount the folder. And the optional third |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
40 |
# argument is a set of non-required options. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
41 |
config.vm.synced_folder "../", "/srv/comt" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
42 |
|
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
43 |
config.vm.define :coment_dev do |coment_dev| |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
44 |
end |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
45 |
|
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
46 |
# Provider-specific configuration so you can fine-tune various |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
47 |
# backing providers for Vagrant. These expose provider-specific options. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
48 |
# Example for VirtualBox: |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
49 |
# |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
50 |
config.vm.provider :virtualbox do |vb| |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
51 |
vb.name = "coment_dev" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
52 |
# # Don't boot with headless mode |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
53 |
# vb.gui = true |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
54 |
# |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
55 |
# # Use VBoxManage to customize the VM. For example to change memory: |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
56 |
# vb.customize ["modifyvm", :id, "--memory", "1024"] |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
57 |
end |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
58 |
# |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
59 |
# View the documentation for the provider you're using for more |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
60 |
# information on available options. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
61 |
|
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
62 |
# Enable provisioning with Puppet stand alone. Puppet manifests |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
63 |
# are contained in a directory path relative to this Vagrantfile. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
64 |
# You will need to create the manifests directory and a manifest in |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
65 |
# the file base.pp in the manifests_path directory. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
66 |
# |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
67 |
# An example Puppet manifest to provision the message of the day: |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
68 |
# |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
69 |
# # group { "puppet": |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
70 |
# # ensure => "present", |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
71 |
# # } |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
72 |
# # |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
73 |
# # File { owner => 0, group => 0, mode => 0644 } |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
74 |
# # |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
75 |
# # file { '/etc/motd': |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
76 |
# # content => "Welcome to your Vagrant-built virtual machine! |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
77 |
# # Managed by Puppet.\n" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
78 |
# # } |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
79 |
# |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
80 |
config.vm.provision :puppet do |puppet| |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
81 |
puppet.manifests_path = "manifests" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
82 |
puppet.manifest_file = "site.pp" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
83 |
puppet.module_path = "modules" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
84 |
puppet.options = "--hiera_config /vagrant/hiera.yaml " |
|
588
8e9ea314e06e
dev box bug correction + minimal doc in README.txt
ymh <ymh.work@gmail.com>
parents:
587
diff
changeset
|
85 |
# puppet.options = "--debug --verbose --hiera_config /vagrant/hiera.yaml " |
|
587
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
86 |
end |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
87 |
|
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
88 |
# Enable provisioning with chef solo, specifying a cookbooks path, roles |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
89 |
# path, and data_bags path (all relative to this Vagrantfile), and adding |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
90 |
# some recipes and/or roles. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
91 |
# |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
92 |
# config.vm.provision :chef_solo do |chef| |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
93 |
# chef.cookbooks_path = "../my-recipes/cookbooks" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
94 |
# chef.roles_path = "../my-recipes/roles" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
95 |
# chef.data_bags_path = "../my-recipes/data_bags" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
96 |
# chef.add_recipe "mysql" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
97 |
# chef.add_role "web" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
98 |
# |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
99 |
# # You may also specify custom JSON attributes: |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
100 |
# chef.json = { :mysql_password => "foo" } |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
101 |
# end |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
102 |
|
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
103 |
# Enable provisioning with chef server, specifying the chef server URL, |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
104 |
# and the path to the validation key (relative to this Vagrantfile). |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
105 |
# |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
106 |
# The Opscode Platform uses HTTPS. Substitute your organization for |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
107 |
# ORGNAME in the URL and validation key. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
108 |
# |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
109 |
# If you have your own Chef Server, use the appropriate URL, which may be |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
110 |
# HTTP instead of HTTPS depending on your configuration. Also change the |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
111 |
# validation key to validation.pem. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
112 |
# |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
113 |
# config.vm.provision :chef_client do |chef| |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
114 |
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
115 |
# chef.validation_key_path = "ORGNAME-validator.pem" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
116 |
# end |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
117 |
# |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
118 |
# If you're using the Opscode platform, your validator client is |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
119 |
# ORGNAME-validator, replacing ORGNAME with your organization name. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
120 |
# |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
121 |
# If you have your own Chef Server, the default validation client name is |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
122 |
# chef-validator, unless you changed the configuration. |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
123 |
# |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
124 |
# chef.validation_client_name = "ORGNAME-validator" |
|
a1aa29e7809f
add a vagrant profile + puppet config for dev box
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
125 |
end |