-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnsible-Vagrantfile
49 lines (44 loc) · 1.39 KB
/
Ansible-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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "controller" do |config|
config.vm.box = "centos/7"
config.vm.provider "virtualbox" do |vb|
vb.name = "controller"
vb.cpus = 2
vb.memory = 2048
end
config.vm.hostname = "controller"
config.vm.network "private_network", ip: "192.168.56.100"
end
config.vm.define "host1" do |config|
config.vm.box = "centos/7"
config.vm.provider "virtualbox" do |vb|
vb.name = "host1"
vb.cpus = 1
vb.memory = 1024
end
config.vm.hostname = "host11"
config.vm.network "private_network", ip: "192.168.56.101"
end
config.vm.define "host2" do |config|
config.vm.box = "centos/7"
config.vm.provider "virtualbox" do |vb|
vb.name = "host2"
vb.cpus = 2
vb.memory = 2048
end
config.vm.hostname = "host2"
config.vm.network "private_network", ip: "192.168.56.102"
end
# Hostmanager plugin
config.hostmanager.enabled = true
config.hostmanager.manage_host = true
config.hostmanager.manage_guest = true
# Enable SSH Password Authentication
config.vm.provision "shell", inline: <<-SHELL
sed -i 's/ChallengeResponseAuthentication no/ChallengeResponseAuthentication yes/g' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
systemctl restart sshd
SHELL
end