Added a basic template for the alpine3.17 VM.

main
KKlochko 2 years ago
commit 5d5f28eb35

@ -0,0 +1,29 @@
* alpine317-template
It's a simple configuration for alpine3.17 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

27
Vagrantfile vendored

@ -0,0 +1,27 @@
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/alpine317"
subconfig.vm.hostname = "alpine-ansible-vm"
subconfig.vm.provider :libvirt do |domain|
domain.memory = 1024
domain.cpus = 1
end
# update package and upgrade system
# install python for ansible
subconfig.vm.provision "shell", inline: <<-SHELL
apk update & apk upgrade
apk add python3 py3-pip
SHELL
subconfig.vm.provision "ansible" do |ansible|
ansible.verbose = "v"
ansible.playbook = "main_playbook.yaml"
end
end
end

@ -0,0 +1,8 @@
---
- hosts: all
become: yes
tasks:
- name: install htop and neofetch
command: apk add htop neofetch
- name: install docker
command: apk add 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