docs + postinstall playbook

This commit is contained in:
Daniel Liu 2021-10-03 17:28:34 -04:00
parent 5164a49ba9
commit 611334046a
7 changed files with 83 additions and 53 deletions

View File

@ -3,54 +3,13 @@ This repo helps quickly set up a vm development environment for cs club's
mirrors using ansible.
There are three options for getting the mirror dev vm running:
- qemu
- libvirt
- manual
- qemu (automated install)
- libvirt (manual install)
Follow the relevant instructions below.
## VM Installation Option 1 (qmeu)
Install the following:
- ansible
- qemu
- genisoimage
- ovmf (find the location of OVMF\_CODE.fd, it is system dependent)
Before doing anything else, edit the config files in `group_vars/` to your
system's needs. For qemu installation specifically, you need to provide the
location of your `OVMF_CODE.fd` file.
To begin the setup process, in this repo's root, run:
```
$ ansible-playbook -K qemu/main.yml
```
Due to the way the ubuntu autoinstall is designed, user confirmation is
required to start the autoinstallation process. To view the vm, you also need a
vnc viewer. [TigerVNC](https://github.com/TigerVNC/tigervnc) is a good choice.
Simply run
```
$ vncviewer :5900
```
Enter `yes` when prompted with
this line:
```
Continue with autoinstall (yes|no)
```
Once the installation is complete, you can run the vm using:
```
$ ansible-playbook qemu/run/yml
```
The default login user has
```
username: ubuntu
password: ubuntu
```
Follow instructions in the README.md of the qemu directory
## VM Install Option 2 (libvirt)
Follow instructions in the README.md of the libvirt directory

23
hosts
View File

@ -1,10 +1,21 @@
# I will move this to the hosts.yml soon
[local]
127.0.0.1
[local:vars]
ansible_connection=local
[vm]
192.168.123.2 host=mirror ansible_connection=ssh ansible_port=22 ansible_user=ubuntu ansible_password=ubuntu ansible_become_user=root ansible_become_password=ubuntu
ubuntu@localhost
[vm:vars]
host=mirror
ansible_connection=ssh
ansible_port=7777
ansible_user=ubuntu
ansible_password=ubuntu
ansible_become_user=root
ansible_become_password=ubuntu
# 192.168.123.2 host=mirror ansible_connection=ssh ansible_port=22 ansible_user=ubuntu ansible_password=ubuntu ansible_become_user=root ansible_become_password=ubuntu
# ansible_ssh_private_key_file
# guide on how to create vm manually (more control, more disks)
# another playbook that runs on such a vm and sets up all the services in roles (except zfs)
[local]
127.0.0.1 ansible_connection=local

50
qemu/README.md Normal file
View File

@ -0,0 +1,50 @@
# Installation
Install the following:
- ansible
- qemu
- genisoimage
- ovmf (find the location of `OVMF\_CODE.fd`, it is system dependent)
Before doing anything else, edit the config files in `group_vars/` to your
system's needs. For qemu installation specifically, you need to provide the
location of your `OVMF_CODE.fd` file.
To begin the setup process, in this repo's root, run:
```
$ ansible-playbook -K qemu/main.yml
```
To view the vm, you also need a vnc viewer.
[TigerVNC](https://github.com/TigerVNC/tigervnc) is a good choice.
Simply run
```
$ vncviewer :5900
```
Currently, this is a bug with the installation process that causes the vm to
not terminate after completing the base install, causing the ansible task to
hang. You can manually terminate ansible once the vm shows:
![installation complete](images/installation_complete.png)
Once the base installation is complete, we need to configure the system in a
postinstall step, start by running the vm with:
```
$ ansible-playbook qemu/run.yml
```
And then run the postinstall playbook:
```
$ ansible-playbook qemu/postinstall.yml
```
The mirror dev environment is now ready to use.
The default login user has
```
username: ubuntu
password: ubuntu
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

10
qemu/postinstall.yml Normal file
View File

@ -0,0 +1,10 @@
---
- hosts: vm
tasks:
- name: Basic system configuration
import_role:
name: ../roles/system
# - name: Setting up ssh
# import_role:
# name: ../roles/ssh