diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8000dd9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vagrant diff --git a/Vagrantfile b/Vagrantfile index 3cf03d0..27b1e99 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,21 +1,31 @@ # -*- mode: ruby -*- # vi: set ft=ruby : - Vagrant.configure("2") do |config| - # Use an Ubuntu 24.04 box (replace with an available box if necessary) - config.vm.box = "generic/ubuntu2404" + config.vm.box = "bento/ubuntu-24.04" + config.vm.box_version = "202404.26.0" # Configure VM provider resources (optional) - config.vm.provider "virtualbox" do |vb| - vb.memory = "4096" - vb.cpus = 2 + config.vm.provider :virtualbox do |v| + v.memory = 4096 + v.cpus = 2 end - # Use Ansible for provisioning - config.vm.provision "ansible" do |ansible| - ansible.playbook = "playbook.yml" # Path to the Ansible playbook relative to the Vagrantfile - ansible.inventory_path = "inventory" # Path to the inventory file - # Extra vars can be defined if needed - # ansible.extra_vars = { some_var: "value" } + + config.vm.define "test" do |v| + v.vm.hostname = "test" + v.vm.network :private_network, ip: "192.168.56.123" + + v.vm.provision "bootstrap", type: "shell" do |s| + s.inline = "sudo apt install ansible -y" + end + # + # Use Ansible for provisioning + v.vm.provision "ansible" do |ansible| + ansible.playbook = "playbook.yml" # Path to the Ansible playbook relative to the Vagrantfile + ansible.inventory_path = "inventory" # Path to the inventory file + # Extra vars can be defined if needed + # ansible.extra_vars = { some_var: "value" } + end + end end diff --git a/inventory b/inventory index 2302eda..ce96218 100644 --- a/inventory +++ b/inventory @@ -1 +1,2 @@ -localhost ansible_connection=local +[local] +test ansible_ssh_host=192.168.30.123 ansible_ssh_port=22 diff --git a/playbook.yml b/playbook.yml index b6b32be..5f1cd16 100644 --- a/playbook.yml +++ b/playbook.yml @@ -1,4 +1,3 @@ -- hosts: localhost - become: true +- hosts: local roles: - setup diff --git a/roles/setup/tasks/ghosttty.yml b/roles/setup/tasks/ghostty.yml similarity index 100% rename from roles/setup/tasks/ghosttty.yml rename to roles/setup/tasks/ghostty.yml