-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
29 lines (26 loc) · 974 Bytes
/
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
Vagrant.configure(2) do |config|
config.vm.define "ansible-nas-test" do
config.vm.box = "debian/bookworm64"
config.vm.network "private_network", ip: "172.10.0.2"
config.vm.provider "virtualbox" do |v|
v.memory = 2048
v.cpus = 2
v.customize [ 'storageattach', :id,
'--storagectl', 'SATA Controller',
'--port', 1,
'--device', 0,
'--type', 'hdd',
'--medium', '.vagrant/test_zdisk.vdi' ]
end
config.vm.provision "ansible" do |ansible|
ansible.inventory_path = "inventories/local/inventory.yml"
ansible.playbook = "nas.yml"
end
config.trigger.after :halt do |trigger|
trigger.info = "Detaching persistent drive"
trigger.ruby do |env,machine|
puts `VBoxManage storageattach '#{machine.id}' --storagectl 'SATA Controller' --port 1 --device 0 --type hdd --medium none`
end
end
end
end