Created
June 1, 2018 12:11
-
-
Save riuvshin/be7c0f3ee246a944c887816d58d2ebff to your computer and use it in GitHub Desktop.
ansible_sandbox_vm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
public_key_path = '~/.ssh/id_rsa.pub' | |
ram = '4096' | |
cpus = '4' | |
config.vm.box = "centos/7" | |
config.vm.box_version = "1801.02" | |
config.ssh.insert_key = false | |
config.vm.network :private_network, ip: "192.168.56.77" | |
config.vm.provider :virtualbox do |vbox| | |
vbox.name = "ansible_sandbox" | |
vbox.customize [ | |
'modifyvm', :id, | |
'--memory', ram, | |
'--cpus', cpus | |
] | |
end | |
config.vm.provision "shell", inline: "sudo systemctl start firewalld.service" | |
config.vm.provision "shell", inline: "sudo mkdir /root/.ssh/" | |
config.vm.provision "file", source: public_key_path, destination: "/tmp/key.pub" | |
config.vm.provision "shell", inline: "sudo cat /tmp/key.pub >> /root/.ssh/authorized_keys" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment