-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
44 lines (39 loc) · 1.55 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
home = ENV['HOME']
ENV["LC_ALL"] = "en_US.UTF-8"
Vagrant.configure(2) do |config|
config.vm.define "ipa" do |ipa|
ipa.vm.box = "centos/7"
ipa.vm.hostname="ipa.otus.loc"
ipa.vm.network :private_network, ip: "192.168.10.10"
ipa.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
vb.cpus = "1"
end
ipa.vm.provision "shell", inline: <<-SHELL
sed -i '65s/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
systemctl restart sshd
systemctl restart network
sed -i '1c\ 192.168.10.10 ipa.otus.loc ipa' /etc/hosts
systemctl start firewalld
SHELL
end
config.vm.define "client" do |client|
client.vm.box = "centos/7"
client.vm.hostname="client.otus.loc"
client.vm.network :"private_network", ip: "192.168.10.20"
client.vm.provider "virtualbox" do |vb|
vb.memory = "512"
vb.cpus = "1"
end
client.vm.provision "shell", inline: <<-SHELL
sed -i '65s/PasswordAuthentication no/PasswordAuthentication yes/g' /etc/ssh/sshd_config
systemctl restart sshd
systemctl restart network
sed -i '1c\ 192.168.10.20 client.otus.loc client' /etc/hosts
sed -i '1a 192.168.10.10 ipa.otus.loc ipa' /etc/hosts
systemctl start firewalld
SHELL
end
end