-
Notifications
You must be signed in to change notification settings - Fork 4
/
Vagrantfile
58 lines (49 loc) · 2.09 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
# Plugin checker by DevNIX: https://github.com/DevNIX/Vagrant-dependency-manager
# vagrant-reload is required to reboot Windows machines and retain Vagrant connection
require File.dirname(__FILE__)+'./Vagrant/Plugin/dependency_manager'
check_plugins ['vagrant-reload']
# Variables
## Boxes
linux_box_name = 'bento/centos-7.6'
linux_box_version = '201812.27.0'
## Network
## NIC Adapter #2 (1st NIC is reserved for Vagrant comms)
net_prefix = '192.168.10'
ansible01_ip = "#{net_prefix}.20"
# Main configuration
Vagrant.configure('2') do |config|
# VirtualBox global box settings
config.vm.provider 'virtualbox' do |vb|
vb.linked_clone = true
vb.gui = true
vb.customize ['modifyvm', :id, '--clipboard', 'bidirectional']
vb.customize ['setextradata', 'global', 'GUI/SuppressMessages', 'all']
end
# Increase timeout in case VMs joining the domain take a while to boot
config.vm.boot_timeout = 1200
# Ansible Control VM
config.vm.define 'ansible01' do |subconfig|
# CPU and RAM
subconfig.vm.provider 'virtualbox' do |vb|
vb.cpus = '2'
vb.memory = '4096'
end
# Hostname and networking
subconfig.vm.hostname = 'ansible01'
subconfig.vm.box = linux_box_name
subconfig.vm.box_version = linux_box_version
subconfig.vm.network 'private_network', ip: ansible01_ip
subconfig.vm.network 'forwarded_port', guest: 22, host: 33520, auto_correct: true
subconfig.vm.synced_folder ".", "/vagrant", type: "rsync", rsync__auto: true
# Provisioning
subconfig.vm.provision 'shell', path: 'vagrant/scripts/install_common.sh'
# Install Ansible
subconfig.vm.provision 'shell', path: 'vagrant/scripts/install_ansible_azure.sh'
# Install Docker
subconfig.vm.provision 'shell', path: 'vagrant/scripts/install_docker_ce.sh'
# Install Ansible AWX
subconfig.vm.provision 'shell', path: 'vagrant/scripts/install_ansible_awx.sh'
# Configure Ansible AWX
subconfig.vm.provision 'shell', path: 'vagrant/scripts/configure_ansible_awx.sh'
end
end