-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
36 lines (30 loc) · 1.16 KB
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# vi: set ft=ruby :
require 'etc'
require 'shellwords'
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "bento/centos-7.4"
config.vm.hostname = File.expand_path(File.dirname(__FILE__)).split('/')[-1]
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", type: "dhcp"
# Tweak the VMs configuration.
config.vm.provider "virtualbox" do |vb|
vb.cpus = Etc.nprocessors
vb.memory = 1024
vb.linked_clone = true
end
# Configure the VM using Ansible
config.vm.provision "ansible_local" do |ansible|
ansible.galaxy_role_file = "requirements.yml"
ansible.galaxy_roles_path = ".ansible/galaxy-roles"
ansible.provisioning_path = "/vagrant"
ansible.playbook = "vagrant.yml"
# allow passing ansible args from environment variable
ansible.raw_arguments = Shellwords::shellwords(ENV.fetch("ANSIBLE_ARGS", ""))
end
end