Advertisement
Guest User

Untitled

a guest
Apr 8th, 2016
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.49 KB | None | 0 0
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3.  
  4. # Config Github Settings
  5. github_username = "fideloper"
  6. github_repo = "Vaprobash"
  7. github_branch = "1.4.2"
  8. github_url = "https://raw.githubusercontent.com/#{github_username}/#{github_repo}/#{github_branch}"
  9.  
  10. # Because this:https://developer.github.com/changes/2014-12-08-removing-authorizations-token/
  11. # https://github.com/settings/tokens
  12. github_pat = ""
  13.  
  14. # Server Configuration
  15.  
  16. hostname = "precise64"
  17.  
  18. # Set a local private network IP address.
  19. # See http://en.wikipedia.org/wiki/Private_network for explanation
  20. # You can use the following IP ranges:
  21. # 10.0.0.1 - 10.255.255.254
  22. # 172.16.0.1 - 172.31.255.254
  23. # 192.168.0.1 - 192.168.255.254
  24. server_ip = "192.168.22.10"
  25. server_cpus = "1" # Cores
  26. server_memory = "384" # MB
  27. server_swap = "768" # Options: false | int (MB) - Guideline: Between one or two times the server_memory
  28.  
  29. # UTC for Universal Coordinated Time
  30. # EST for Eastern Standard Time
  31. # CET for Central European Time
  32. # US/Central for American Central
  33. # US/Eastern for American Eastern
  34. server_timezone = "UTC"
  35.  
  36. # Database Configuration
  37. mysql_root_password = "mysql" # We'll assume user "root"
  38. mysql_version = "5.5" # Options: 5.5 | 5.6
  39. mysql_enable_remote = "false" # remote access enabled when true
  40. pgsql_root_password = "root" # We'll assume user "root"
  41. mongo_version = "2.6" # Options: 2.6 | 3.0
  42. mongo_enable_remote = "false" # remote access enabled when true
  43.  
  44. # Languages and Packages
  45. php_timezone = "UTC" # http://php.net/manual/en/timezones.php
  46. php_version = "5.6" # Options: 5.5 | 5.6
  47. ruby_version = "latest" # Choose what ruby version should be installed (will also be the default version)
  48. ruby_gems = [ # List any Ruby Gems that you want to install
  49. #"jekyll",
  50. #"sass",
  51. #"compass",
  52. ]
  53.  
  54. go_version = "latest" # Example: go1.4 (latest equals the latest stable version)
  55.  
  56. # To install HHVM instead of PHP, set this to "true"
  57. hhvm = "false"
  58.  
  59. # PHP Options
  60. composer_packages = [ # List any global Composer packages that you want to install
  61. #"phpunit/phpunit:4.0.*",
  62. #"codeception/codeception=*",
  63. #"phpspec/phpspec:2.0.*@dev",
  64. #"squizlabs/php_codesniffer:1.5.*",
  65. ]
  66.  
  67. # Default web server document root
  68. # Symfony's public directory is assumed "web"
  69. # Laravel's public directory is assumed "public"
  70. public_folder = "/vagrant"
  71.  
  72. laravel_root_folder = "/vagrant/laravel" # Where to install Laravel. Will `composer install` if a composer.json file exists
  73. laravel_version = "latest-stable" # If you need a specific version of Laravel, set it here
  74. symfony_root_folder = "/vagrant/symfony" # Where to install Symfony.
  75.  
  76. nodejs_version = "latest" # By default "latest" will equal the latest stable version
  77. nodejs_packages = [ # List any global NodeJS packages that you want to install
  78. #"grunt-cli",
  79. #"gulp",
  80. #"bower",
  81. #"yo",
  82. ]
  83.  
  84. # RabbitMQ settings
  85. rabbitmq_user = "user"
  86. rabbitmq_password = "password"
  87.  
  88. sphinxsearch_version = "rel22" # rel20, rel21, rel22, beta, daily, stable
  89.  
  90.  
  91. Vagrant.configure("2") do |config|
  92.  
  93. # Set server to Ubuntu 14.04
  94. config.vm.box = "ubuntu/trusty64"
  95.  
  96. config.vm.define "Vaprobash" do |vapro|
  97. end
  98.  
  99. if Vagrant.has_plugin?("vagrant-hostmanager")
  100. config.hostmanager.enabled = true
  101. config.hostmanager.manage_host = true
  102. config.hostmanager.ignore_private_ip = false
  103. config.hostmanager.include_offline = false
  104. end
  105.  
  106. # Create a hostname, don't forget to put it to the `hosts` file
  107. # This will point to the server's default virtual host
  108. # TO DO: Make this work with virtualhost along-side xip.io URL
  109. config.vm.hostname = hostname
  110.  
  111. # Create a static IP
  112. if Vagrant.has_plugin?("vagrant-auto_network")
  113. config.vm.network :private_network, :ip => "0.0.0.0", :auto_network => true
  114. else
  115. config.vm.network :private_network, ip: server_ip
  116. config.vm.network :forwarded_port, guest: 80, host: 8000
  117. end
  118.  
  119. # Enable agent forwarding over SSH connections
  120. config.ssh.forward_agent = true
  121.  
  122. # Use NFS for the shared folder
  123. config.vm.synced_folder ".", "/vagrant",
  124. id: "core",
  125. :nfs => true,
  126. :mount_options => ['nolock,vers=3,udp,noatime,actimeo=2,fsc']
  127.  
  128. # Replicate local .gitconfig file if it exists
  129. if File.file?(File.expand_path("~/.gitconfig"))
  130. config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
  131. end
  132.  
  133. # If using VirtualBox
  134. config.vm.provider :virtualbox do |vb|
  135.  
  136. vb.name = hostname
  137.  
  138. # Set server cpus
  139. vb.customize ["modifyvm", :id, "--cpus", server_cpus]
  140.  
  141. # Set server memory
  142. vb.customize ["modifyvm", :id, "--memory", server_memory]
  143.  
  144. # Set the timesync threshold to 10 seconds, instead of the default 20 minutes.
  145. # If the clock gets more than 15 minutes out of sync (due to your laptop going
  146. # to sleep for instance, then some 3rd party services will reject requests.
  147. vb.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000]
  148.  
  149. # Prevent VMs running on Ubuntu to lose internet connection
  150. # vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
  151. # vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
  152.  
  153. end
  154.  
  155. # If using VMWare Fusion
  156. config.vm.provider "vmware_fusion" do |vb, override|
  157. override.vm.box_url = "http://files.vagrantup.com/precise64_vmware.box"
  158.  
  159. # Set server memory
  160. vb.vmx["memsize"] = server_memory
  161.  
  162. end
  163.  
  164. # If using Vagrant-Cachier
  165. # http://fgrehm.viewdocs.io/vagrant-cachier
  166. if Vagrant.has_plugin?("vagrant-cachier")
  167. # Configure cached packages to be shared between instances of the same base box.
  168. # Usage docs: http://fgrehm.viewdocs.io/vagrant-cachier/usage
  169. config.cache.scope = :box
  170.  
  171. config.cache.synced_folder_opts = {
  172. type: :nfs,
  173. mount_options: ['rw', 'vers=3', 'tcp', 'nolock']
  174. }
  175. end
  176.  
  177. # Adding vagrant-digitalocean provider - https://github.com/smdahlen/vagrant-digitalocean
  178. # Needs to ensure that the vagrant plugin is installed
  179. config.vm.provider :digital_ocean do |provider, override|
  180. override.ssh.private_key_path = '~/.ssh/id_rsa'
  181. override.ssh.username = 'vagrant'
  182. override.vm.box = 'digital_ocean'
  183. override.vm.box_url = "https://github.com/smdahlen/vagrant-digitalocean/raw/master/box/digital_ocean.box"
  184.  
  185. provider.token = 'YOUR TOKEN'
  186. provider.image = 'ubuntu-14-04-x64'
  187. provider.region = 'nyc2'
  188. provider.size = '512mb'
  189. end
  190.  
  191. ####
  192. # Base Items
  193. ##########
  194.  
  195. # Provision Base Packages
  196. config.vm.provision "shell", path: "#{github_url}/scripts/base.sh", args: [github_url, server_swap, server_timezone]
  197.  
  198. # optimize base box
  199. config.vm.provision "shell", path: "#{github_url}/scripts/base_box_optimizations.sh", privileged: true
  200.  
  201. # Provision PHP
  202. config.vm.provision "shell", path: "#{github_url}/scripts/php.sh", args: [php_timezone, hhvm, php_version]
  203.  
  204. # Enable MSSQL for PHP
  205. # config.vm.provision "shell", path: "#{github_url}/scripts/mssql.sh"
  206.  
  207. # Provision Vim
  208. config.vm.provision "shell", path: "#{github_url}/scripts/vim.sh", args: github_url
  209.  
  210. # Provision Docker
  211. # config.vm.provision "shell", path: "#{github_url}/scripts/docker.sh", args: "permissions"
  212.  
  213. ####
  214. # Web Servers
  215. ##########
  216.  
  217. # Provision Apache Base
  218. # config.vm.provision "shell", path: "#{github_url}/scripts/apache.sh", args: [server_ip, public_folder, hostname, github_url]
  219.  
  220. # Provision Nginx Base
  221. config.vm.provision "shell", path: "#{github_url}/scripts/nginx.sh", args: [server_ip, public_folder, hostname, github_url]
  222.  
  223.  
  224. ####
  225. # Databases
  226. ##########
  227.  
  228. # Provision MySQL
  229. config.vm.provision "shell", path: "#{github_url}/scripts/mysql.sh", args: [mysql_root_password, mysql_version, mysql_enable_remote]
  230.  
  231. # Provision PostgreSQL
  232. # config.vm.provision "shell", path: "#{github_url}/scripts/pgsql.sh", args: pgsql_root_password
  233.  
  234. # Provision SQLite
  235. # config.vm.provision "shell", path: "#{github_url}/scripts/sqlite.sh"
  236.  
  237. # Provision RethinkDB
  238. # config.vm.provision "shell", path: "#{github_url}/scripts/rethinkdb.sh", args: pgsql_root_password
  239.  
  240. # Provision Couchbase
  241. # config.vm.provision "shell", path: "#{github_url}/scripts/couchbase.sh"
  242.  
  243. # Provision CouchDB
  244. # config.vm.provision "shell", path: "#{github_url}/scripts/couchdb.sh"
  245.  
  246. # Provision MongoDB
  247. # config.vm.provision "shell", path: "#{github_url}/scripts/mongodb.sh", args: [mongo_enable_remote, mongo_version]
  248.  
  249. # Provision MariaDB
  250. # config.vm.provision "shell", path: "#{github_url}/scripts/mariadb.sh", args: [mysql_root_password, mysql_enable_remote]
  251.  
  252. # Provision Neo4J
  253. # config.vm.provision "shell", path: "#{github_url}/scripts/neo4j.sh"
  254.  
  255. ####
  256. # Search Servers
  257. ##########
  258.  
  259. # Install Elasticsearch
  260. # config.vm.provision "shell", path: "#{github_url}/scripts/elasticsearch.sh"
  261.  
  262. # Install SphinxSearch
  263. # config.vm.provision "shell", path: "#{github_url}/scripts/sphinxsearch.sh", args: [sphinxsearch_version]
  264.  
  265. ####
  266. # Search Server Administration (web-based)
  267. ##########
  268.  
  269. # Install ElasticHQ
  270. # Admin for: Elasticsearch
  271. # Works on: Apache2, Nginx
  272. # config.vm.provision "shell", path: "#{github_url}/scripts/elastichq.sh"
  273.  
  274.  
  275. ####
  276. # In-Memory Stores
  277. ##########
  278.  
  279. # Install Memcached
  280. config.vm.provision "shell", path: "#{github_url}/scripts/memcached.sh"
  281.  
  282. # Provision Redis (without journaling and persistence)
  283. config.vm.provision "shell", path: "#{github_url}/scripts/redis.sh"
  284.  
  285. # Provision Redis (with journaling and persistence)
  286. # config.vm.provision "shell", path: "#{github_url}/scripts/redis.sh", args: "persistent"
  287. # NOTE: It is safe to run this to add persistence even if originally provisioned without persistence
  288.  
  289.  
  290. ####
  291. # Utility (queue)
  292. ##########
  293.  
  294. # Install Beanstalkd
  295. # config.vm.provision "shell", path: "#{github_url}/scripts/beanstalkd.sh"
  296.  
  297. # Install Heroku Toolbelt
  298. # config.vm.provision "shell", path: "https://toolbelt.heroku.com/install-ubuntu.sh"
  299.  
  300. # Install Supervisord
  301. # config.vm.provision "shell", path: "#{github_url}/scripts/supervisord.sh"
  302.  
  303. # Install Kibana
  304. # config.vm.provision "shell", path: "#{github_url}/scripts/kibana.sh"
  305.  
  306. # Install ØMQ
  307. # config.vm.provision "shell", path: "#{github_url}/scripts/zeromq.sh"
  308.  
  309. # Install RabbitMQ
  310. # config.vm.provision "shell", path: "#{github_url}/scripts/rabbitmq.sh", args: [rabbitmq_user, rabbitmq_password]
  311.  
  312. ####
  313. # Additional Languages
  314. ##########
  315.  
  316. # Install Nodejs
  317. # config.vm.provision "shell", path: "#{github_url}/scripts/nodejs.sh", privileged: false, args: nodejs_packages.unshift(nodejs_version, github_url)
  318.  
  319. # Install Ruby Version Manager (RVM)
  320. # config.vm.provision "shell", path: "#{github_url}/scripts/rvm.sh", privileged: false, args: ruby_gems.unshift(ruby_version)
  321.  
  322. # Install Go Version Manager (GVM)
  323. # config.vm.provision "shell", path: "#{github_url}/scripts/go.sh", privileged: false, args: [go_version]
  324.  
  325. ####
  326. # Frameworks and Tooling
  327. ##########
  328.  
  329. # Provision Composer
  330. # You may pass a github auth token as the first argument
  331. config.vm.provision "shell", path: "#{github_url}/scripts/composer.sh", privileged: false, args: [github_pat, composer_packages.join(" ")]
  332.  
  333. # Provision Laravel
  334. # config.vm.provision "shell", path: "#{github_url}/scripts/laravel.sh", privileged: false, args: [server_ip, laravel_root_folder, public_folder, laravel_version]
  335.  
  336. # Provision Symfony
  337. # config.vm.provision "shell", path: "#{github_url}/scripts/symfony.sh", privileged: false, args: [server_ip, symfony_root_folder, public_folder]
  338.  
  339. # Install Screen
  340. # config.vm.provision "shell", path: "#{github_url}/scripts/screen.sh"
  341.  
  342. # Install Mailcatcher
  343. # config.vm.provision "shell", path: "#{github_url}/scripts/mailcatcher.sh"
  344.  
  345. # Install git-ftp
  346. # config.vm.provision "shell", path: "#{github_url}/scripts/git-ftp.sh", privileged: false
  347.  
  348. # Install Ansible
  349. # config.vm.provision "shell", path: "#{github_url}/scripts/ansible.sh"
  350.  
  351. # Install Android
  352. # config.vm.provision "shell", path: "#{github_url}/scripts/android.sh"
  353.  
  354. ####
  355. # Local Scripts
  356. # Any local scripts you may want to run post-provisioning.
  357. # Add these to the same directory as the Vagrantfile.
  358. ##########
  359. # config.vm.provision "shell", path: "./local-script.sh"
  360.  
  361. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement