blob: ccca7c23982090937c5c7a84cf4600ed45ad56a1 (
plain)
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
49
50
51
52
53
|
# -*- mode: ruby -*-
# vi: set ts=2 sw=2 sts=2 et ft=ruby :
Vagrant.configure(2) do |config|
config.vm.provider :openstack do |os, override|
config.vm.box = "dummy"
# require an IMAGE to be passed in
# IMAGE must be a human name and not image ID!
if ENV['IMAGE']
os.image = ENV['IMAGE']
else
os.image = 'BAD IMAGE'
override.ssh.username = 'baduser'
end
case ENV['IMAGE']
when /.*ubuntu.*/i
override.ssh.username = 'ubuntu'
when /.*fedora.*/i
override.ssh.username = 'fedora'
# take care of the tty requirement by fedora for sudo
os.user_data = "#!/bin/bash
/bin/sed -i 's/ requiretty/ !requiretty/' /etc/sudoers;"
when /.*centos.*/i
override.ssh.username = 'centos'
# take care of the tty requirement by centos for sudo
os.user_data = "#!/bin/bash
/bin/sed -i 's/ requiretty/ !requiretty/' /etc/sudoers;"
end
end
config.vm.synced_folder ".", "/vagrant"
config.vm.synced_folder "../lib/", "/vagrant/lib"
# Do a full system update and set enforcing on
config.vm.provision 'shell', path: './bootstrap.sh'
#################
# FINAL CLEANUP #
#################
# set RESEAL to... anything if you want to snap an image of this box
# not setting the environment variable will cause the system to come
# up fully and not be in a resealable state
if ENV['RESEAL']
config.vm.provision 'shell', path: '../lib/system_reseal.sh'
end
end
|