# Download https://raw.githubusercontent.com/shimarulin/workstation/main/tools/bin/install
# with Curl
bash <(curl -sSL https://rb.gy/q38a2u)
See User guide / Getting started for details.
⚠️ Before starting the configuration, make sure that the variables in thegroup_vars/all
file in the repository root are defined. If not, you can set up it viasetvars
script:# Setup Ansible variables ~/.config/workstation/tools/bin/setvars
Run playbook on localhost with common configuration
cd ~/.config/workstation && ansible-playbook playbooks/gnome.yml
Run playbook on localhost for desktop setup
cd ~/.config/workstation && ansible-playbook playbooks/gnome.yml --tags "desktop"
Run playbook on localhost for laptop setup
cd ~/.config/workstation && ansible-playbook playbooks/gnome.yml --tags "laptop"
Documentation:
Requirements:
- Python 3
- Ansible
- VirtualBox
- Vagrant
- Copier
Addition requirements:
- NodeJS
- Yarn
Also, you should install python-vagrant
and copier
packages via pip:
# Install packages
pip install -U python-vagrant copier
For enable Git Hook's to autoformatting files with Prettier just install NodeJS packages with Yarn:
yarn
# Setup Ansible variables
./tools/bin/setvars
# Setup Ansible variables
copier tools/templates/template_ansible_vars ./
# or
# ./tools/scripts/setvars.sh
If you add variables manually, don't forget to change variables template in templates/vars
. It will be used for setup
variables before run playbook for setup target environment.
# Create Ansible role
./tools/bin/mkrole
VM Settings -> Shared Folders -> Adds new shared folder:
- Folder Path: /home/username/path-to-project/workstation
- Folder Name: workstation
- Mount point: /home/username/workstation
- Auto mount: enable
sudo pacman -Sy virtualbox-guest-utils-nox
sudo systemctl enable vboxservice.service
sudo gpasswd -a user vboxsf
sudo reboot
cd ~/workstation && ./get
Create new virtual machine and install target distributive. In according to Vagrant conventions, create user vagrant
with password vagrant
. This password don't need to run playbook, and you can choose other if you need. After this it
needs setup to use as Vagrant box.
Install and enable SSH server:
sudo pacman -Sy openssh
sudo systemctl enable sshd.service
Add unsafe public key:
mkdir -pm 700 ~/.ssh
curl -L https://git.io/v47gO -o ~/.ssh/authorized_keys
# or
# curl -L https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub -o ~/.ssh/authorized_keys
# or
# wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys
chmod 0600 /home/vagrant/.ssh/authorized_keys
And add to end of file /etc/sudoers
using the command sudo visudo
(use sudo EDITOR=nvim visudo
for change default
editor) these strings to connect to virtual machine via ssh without password:
# Vagrant required
vagrant ALL=(ALL:ALL) NOPASSWD: ALL
To make you own box you should run command
# VirtualBox VM name: Arch
vagrant package --base Arch --output arch.box
After this you can add you box:
vagrant box add ./arch.box --name vagrant/arch
# Start VM
vagrant up
# Replay tasks
vagrant provision
# Stop VM
vagrant halt
# Reset and restart VM
vagrant destroy && vagrant up
Connect to virtual machine by ssh
vagrant ssh
In project root:
vagrant destroy
pacman -S virtualbox-guest-utils
sudo systemctl enable vboxservice