Advertisement
DawnHawkBG

Vagrantfile

Apr 6th, 2020
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3.  
  4. def createVagrantDir( path )
  5. dir = File.join(".vagrant", path)
  6. FileUtils.mkdir_p( dir ) unless File.exists?(dir)
  7. return dir
  8. end
  9.  
  10. if Vagrant::VERSION < "1.8.0"
  11. print( "Vagrant version needs to be grader than 1.8.0" )
  12. exit
  13. end
  14.  
  15. chef_node_path = createVagrantDir("node")
  16.  
  17. ################################################################################################################
  18.  
  19. Vagrant.configure("2") do |config|
  20.  
  21. config.vm.box = "bento/centos-7.6"
  22.  
  23. # [ 'vagrant-omnibus', 'vagrant-hostmanager', 'vagrant-hosts' ].each do |plugin|
  24. # system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
  25. # end
  26.  
  27. # config.hostmanager.enabled = true
  28. # config.hostmanager.manage_host = true
  29. # config.hostmanager.manage_guest = false
  30.  
  31. config.vm.define "test", primary: true do |api|
  32. api.vm.provider "virtualbox" do |vb|
  33. vb.memory = "4096"
  34. end
  35.  
  36. # config.vm.network "private_network", ip: "10.10.10.201"
  37.  
  38. ################################################################################################################
  39.  
  40. api.vm.provision "install modules", type: "shell", inline: <<-SHELL
  41. yum install -y yum-utils
  42. yum install -y git
  43. yum install -y vim
  44. yum install -y epel-release
  45. yum update -y epel-release
  46. yum install -y atop
  47. yum install -y php-pear
  48. yum install -y nginx
  49. #yum install -y composer
  50. SHELL
  51.  
  52. api.vm.provision "phpunit", type: "shell", inline: <<-SHELL
  53. wget https://phar.phpunit.de/phpunit-7.0.phar
  54. /bin/mv phpunit-7.0.phar /usr/bin/phpunit
  55. SHELL
  56.  
  57. api.vm.provision "install cassandra", type: "shell", inline: <<-SHELL
  58. cp /vagrant/provision/cassandra.repo /etc/yum.repos.d/cassandra.repo
  59. yum install -y cassandra
  60. SHELL
  61.  
  62. api.vm.provision "install php", type: "shell", inline: <<-SHELL
  63. sudo yum-config-manager --enable remi-php72
  64. yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
  65. yum install -y php72
  66. yum install -y php72-php-fpm.x86_64
  67. yum install -y php72-php-pecl-cassandra.x86_64
  68. yum install -y php72-php-pecl-memcached.x86_64
  69. yum install -y php72-php-json
  70. yum install -y php72-php-mbstring
  71. yum install -y php72-php-opcache.x86_64
  72. yum install -y php72-php-pecl-zip.x86_64
  73. yum install -y php72-php-xml.x86_64
  74. /bin/cp /usr/bin/php72 /usr/bin/php
  75. SHELL
  76.  
  77.  
  78. api.vm.provision "start services", type: "shell", inline: <<-SHELL
  79. service cassandra start
  80. SHELL
  81.  
  82. api.vm.post_up_message = "#StayHome"
  83. end
  84. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement