-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
108 lines (97 loc) · 3.66 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# -*- mode: ruby -*-
# vi: set ft=ruby :
######################################################################
# Customisation. Change variables here!
#
# hostonly_network_ip_address: set this to a network that is not used on your machine.
#
hostonly_network_ip_address = "192.168.56.20"
#
# virtual machine number of cpus.
#
vm_cpus = "2"
#
# virtual machine memory.
#
vm_memory = "4096"
#
# hostname (without .local)
#
vm_hostname = "oracle19c"
#
# 19c
dbDest = "/u01"
dbName = "cdb1"
pdbName = "pdb1"
dbPass = "OraPasswd1"
#
# ZFSA Server
zfsaIP = "192.168.56.101"
zfsaName = "zfsa"
zfsaShare = "/export/oradata"
#
######################################################################
#
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
unless Vagrant.has_plugin?("vagrant-reload")
puts 'Installing vagrant-reload Plugin...'
system('vagrant plugin install vagrant-reload')
end
unless Vagrant.has_plugin?("vagrant-proxyconf")
puts 'Installing vagrant-proxyconf Plugin...'
system('vagrant plugin install vagrant-proxyconf')
end
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "ol7-latest"
config.vm.box_url = "https://yum.oracle.com/boxes/oraclelinux/latest/ol7-latest.box"
config.vm.hostname = "#{vm_hostname}.localdomain"
# synced_folder is disabled. it requires a kernel module that is specific to a kernel.
# this module will not be there once the kernel is upgraded.
config.vm.synced_folder "vagrant", "/vagrant", disabled: false
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
config.vm.network "forwarded_port", guest: 8080, host: 8080
config.vm.network "forwarded_port", guest: 8443, host: 8443
config.vm.network "forwarded_port", guest: 1521, host: 1521
config.vm.network "forwarded_port", guest: 5500, host: 5500
# Create a private network, which allows host-only access to the machine
# using a specific IP.
config.vm.network "private_network", ip: "#{hostonly_network_ip_address}"
config.vm.provider "virtualbox" do |vb|
vb.gui = false
vb.name = "#{vm_hostname}"
vb.memory = "#{vm_memory}"
vb.cpus = "#{vm_cpus}"
vb.customize ["modifyvm", :id, "--description", "#{vm_hostname}: #{hostonly_network_ip_address}\n"]
vb.customize ["modifyvm", :id, "--nic1", "nat", "--cableconnected1", "on", "--nictype1", "virtio"]
vb.customize ["modifyvm", :id, "--nic2", "hostonly", "--hostonlyadapter2", "vboxnet0", "--cableconnected2", "on", "--nictype2", "virtio"]
end
# Run Ansible from the Vagrant VM
config.vm.provision "ansible_local" do |ansible|
ansible.playbook = "playbook.yml"
#ansible.verbose = "-vvv"
ansible.version = "latest"
ansible.inventory_path = "inventory"
ansible.install = true
ansible.limit = "all" # or only "nodes" group, etc.
ansible.extra_vars = {
zfsaIP: zfsaIP,
zfsaName: zfsaName,
zfsaShare: zfsaShare,
dbName: dbName,
pdbName: pdbName,
dbDest: dbDest,
dbPass: dbPass
}
end
end