diff --git a/Vagrantfile b/Vagrantfile index 386fc31..6a82b9b 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,4 +1,10 @@ Vagrant.configure("2") do |config| config.vm.box = "generic/ubuntu2204" - config.ssh.private_key_path = "~/.ssh/id_rsa" + config.vm.provision "shell" do |s| + ssh_pub_key = File.readlines("/home/rralambo/.ssh/id_rsa.pub").first.strip + s.inline = <<-SHELL + echo #{ssh_pub_key} >> /home/vagrant/.ssh/authorized_keys + echo #{ssh_pub_key} >> /root/.ssh/authorized_keys + SHELL + end end \ No newline at end of file diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..e69de29 diff --git a/inventory.yml b/inventory.yml new file mode 100644 index 0000000..50c802c --- /dev/null +++ b/inventory.yml @@ -0,0 +1,6 @@ + +hosts: + hosts: + 127.0.0.1: + ansible_port: 2222 + ansible_user: vagrant \ No newline at end of file diff --git a/setup_test_env.sh b/setup_test_env.sh index c36ca27..65eb04d 100644 --- a/setup_test_env.sh +++ b/setup_test_env.sh @@ -1,5 +1,3 @@ #!/bin/bash -export VAGRANT_HOME=/goinfre/$(whoami)/.vagrant.d - -vagrant up \ No newline at end of file +export VAGRANT_HOME=/goinfre/$(whoami)/.vagrant.d \ No newline at end of file