This repository was archived by the owner on Feb 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
66 lines (58 loc) · 2.19 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Optimized for Vagrant 1.8 and above, which introduced `ansible_local` provisioner
# See https://github.com/hashicorp/vagrant/blob/v1.8.0/CHANGELOG.md
Vagrant.require_version '>= 1.8.0'
# See https://www.vagrantup.com/docs/other/environmental-variables.html#vagrant_no_parallel
ENV['VAGRANT_NO_PARALLEL'] = 'yes'
# @name: KirbyDev
# @author: S1SYYPHOS
# @version: v0.1
Vagrant.configure(2) do |config|
# Settings
conf = {
name: 'KirbyDev',
image: 'generic/ubuntu2004',
driver: 'kvm',
ip: '192.168.69.69',
synced_folder: '/vagrant',
mount_options: ['nolock,actimeo=2'],
cpus: 2,
memory: 2048,
ansible: '2.9.6',
playbook: 'lib/ansible/playbook.yml',
}
# Basic VM settings
config.vm.define conf[:name]
config.vm.hostname = conf[:name]
config.vm.box = conf[:image]
config.vm.synced_folder '.', conf[:synced_folder], type: 'nfs', mount_options: conf[:mount_options]
# config.vm.synced_folder '.', conf[:synced_folder], type: 'nfs'
# Network settings
config.vm.network :private_network, ip: conf[:ip]
config.vm.network :forwarded_port, guest: 80, host: 80
config.vm.network :forwarded_port, guest: 443, host: 443
config.vm.network :forwarded_port, guest: 9090, host: 9090
# Create VM using KVM hypervisor
# See https://github.com/vagrant-libvirt/vagrant-libvirt
config.vm.provider :libvirt do |libvirt|
# Provider settings
libvirt.driver = conf[:driver]
libvirt.cpus = conf[:cpus]
libvirt.memory = conf[:memory]
end
# Disable default behavior introduced in Vagrant 1.7, ensuring
# that all Vagrant machines will use the same SSH key pair
# See https://github.com/mitchellh/vagrant/issues/5005
config.ssh.insert_key = false
config.ssh.keep_alive = true
# Provision VM using Ansible
# See https://www.vagrantup.com/docs/provisioning/ansible_local
config.vm.provision :ansible_local do |ansible|
ansible.playbook = conf[:playbook]
ansible.version = conf[:ansible]
ansible.install_mode = 'pip3'
# Enable as needed
# ansible.verbose = 'vv'
end
end