-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
48 lines (40 loc) · 1.42 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
37
38
39
40
41
42
43
44
45
46
47
48
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
# config.vm.box = "gsfjohnson/centos71-m"
config.vm.box = "gsfjohnson/centos67"
config.vm.define "tacplus" do |v|
v.vm.provider "virtualbox" do |vb|
vb.memory = "512"
end
v.vm.hostname = "tacplus"
v.vm.provision "shell", inline: <<-SHELL
echo
echo Use \\\'vagrant ssh\\\' to enter client environment and run:
echo ansible-playbook -i inventory playbook.yml --diff
SHELL
end
config.vm.box_check_update = true
# config.vm.synced_folder "../data", "/vagrant_data"
config.vm.provision "shell", inline: <<-SHELL
echo Disable selinux... [setenforce 0]
setenforce 0
cp /vagrant/{*.yml,inventory} .
cp -a /vagrant/group_vars .
chmod a-x {*.yml,inventory}
chown vagrant:vagrant {*.yml,inventory,group_vars}
echo Install git and ansible w/ yum... [yum -q -y install ansible git yum-utils]
yum -q -y install ansible git yum-utils
echo Download ansible roles... [/vagrant/setup_roles.sh]
/vagrant/setup_roles.sh
if [ -e /vagrant/gitconfig ]; then
cp -v /vagrant/gitconfig /home/vagrant/.gitconfig
chown -v vagrant:vagrant /home/vagrant/.gitconfig
fi
if [ -e /vagrant/id_rsa ]; then
cp -v /vagrant/id_rsa /home/vagrant/.ssh/id_rsa
chmod -v 0600 /home/vagrant/.ssh/id_rsa
chown -v vagrant:vagrant /home/vagrant/.ssh/id_rsa
fi
SHELL
end