Added a basic template for the debian11 VM.

main
KKlochko 2 years ago
commit 1f5fd017de

@ -0,0 +1,29 @@
* debian11-template
It's a simple configuration for debian11 using Vagrant and Ansible.
* Using
⚠ WARNING ⚠️
Setup virt-manager, QEMU and libvirt for using configuration.
I'm using nix-shell for running vagrant and ansible.
You can just install them to your host or install nix for using nix-shell.
Open a shell in the repository folder.
Run to open the VM:
#+BEGIN_SRC shell
nix-shell
vagrant up
vagrant ssh
#+END_SRC
To close:
#+BEGIN_SRC shell
logout
vagrant halt
#+END_SRC
To remove VM:
#+BEGIN_SRC shell
vagrant destroy
#+END_SRC

20
Vagrantfile vendored

@ -0,0 +1,20 @@
Vagrant.configure("2") do |config|
config.vm.provider :libvirt do |libvirt|
libvirt.driver = "kvm"
end
config.vm.define "main" do |subconfig|
subconfig.vm.box = "generic/debian11"
subconfig.vm.hostname = "debian11-ansible-vm"
subconfig.vm.provider :libvirt do |domain|
domain.memory = 4096
domain.cpus = 1
end
subconfig.vm.provision "ansible" do |ansible|
ansible.verbose = "v"
ansible.playbook = "main_playbook.yaml"
end
end
end

@ -0,0 +1,22 @@
---
- hosts: all
become: yes
tasks:
- name: Update apt cache
apt:
update_cache: yes
- name: Upgrade all packages
apt:
upgrade: dist
autoremove: yes
autoclean: yes
- name: install neofetch
apt:
name:
- neofetch
- name: install docker
apt:
name:
- docker
- docker-compose

@ -0,0 +1,12 @@
{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell {
name = "VagrantShell";
buildInputs = with pkgs; [
vagrant
ansible
];
shellHook = ''
echo "Welcome to vagrant shell";
'';
}
Loading…
Cancel
Save