Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- mode: ruby -*-
- # vi: set ft=ruby :
- def createVagrantDir( path )
- dir = File.join(".vagrant", path)
- FileUtils.mkdir_p( dir ) unless File.exists?(dir)
- return dir
- end
- if Vagrant::VERSION < "1.8.0"
- print( "Vagrant version needs to be grader than 1.8.0" )
- exit
- end
- chef_node_path = createVagrantDir("node")
- ################################################################################################################
- Vagrant.configure("2") do |config|
- config.vm.box = "bento/centos-7.6"
- # [ 'vagrant-omnibus', 'vagrant-hostmanager', 'vagrant-hosts' ].each do |plugin|
- # system "vagrant plugin install #{plugin}" unless Vagrant.has_plugin? plugin
- # end
- # config.hostmanager.enabled = true
- # config.hostmanager.manage_host = true
- # config.hostmanager.manage_guest = false
- config.vm.define "test", primary: true do |api|
- api.vm.provider "virtualbox" do |vb|
- vb.memory = "4096"
- end
- # config.vm.network "private_network", ip: "10.10.10.201"
- ################################################################################################################
- api.vm.provision "install modules", type: "shell", inline: <<-SHELL
- yum install -y yum-utils
- yum install -y git
- yum install -y vim
- yum install -y epel-release
- yum update -y epel-release
- yum install -y atop
- yum install -y php-pear
- yum install -y nginx
- #yum install -y composer
- SHELL
- api.vm.provision "phpunit", type: "shell", inline: <<-SHELL
- wget https://phar.phpunit.de/phpunit-7.0.phar
- /bin/mv phpunit-7.0.phar /usr/bin/phpunit
- SHELL
- api.vm.provision "install cassandra", type: "shell", inline: <<-SHELL
- cp /vagrant/provision/cassandra.repo /etc/yum.repos.d/cassandra.repo
- yum install -y cassandra
- SHELL
- api.vm.provision "install php", type: "shell", inline: <<-SHELL
- sudo yum-config-manager --enable remi-php72
- yum install -y http://rpms.remirepo.net/enterprise/remi-release-7.rpm
- yum install -y php72
- yum install -y php72-php-fpm.x86_64
- yum install -y php72-php-pecl-cassandra.x86_64
- yum install -y php72-php-pecl-memcached.x86_64
- yum install -y php72-php-json
- yum install -y php72-php-mbstring
- yum install -y php72-php-opcache.x86_64
- yum install -y php72-php-pecl-zip.x86_64
- yum install -y php72-php-xml.x86_64
- /bin/cp /usr/bin/php72 /usr/bin/php
- SHELL
- api.vm.provision "start services", type: "shell", inline: <<-SHELL
- service cassandra start
- SHELL
- api.vm.post_up_message = "#StayHome"
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement