From 1c3cb51b21dad8128b1a8e4cb7e3743f8a9830a9 Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Sat, 2 Oct 2021 02:41:27 -0400 Subject: [PATCH] add docs to ubuntu install --- README.md | 11 +++ libvirt/README.md | 116 ++++++++++++++++++++----- roles/ftp/tasks/main.yml | 4 +- roles/mirror/templates/cron/csc-mirror | 55 ++++++------ 4 files changed, 135 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 08ff31f..8fad392 100644 --- a/README.md +++ b/README.md @@ -85,3 +85,14 @@ vdf 252:80 0 10G 0 disk └─vdf9 252:89 0 8M 0 part ``` Drives vda and vdb are for the main filesystem, they use raid1. Drives vdc, vdd, vde and vdf are in a raidz2 zpool. + +## Issues/Remarks +- `/etc/cron.d/csc-mirror` is commented out for now +- need to update `/home/mirror/config/(ADDRESS|ADDRESS_V6)` +- `/mirror/root/include/motd.msg` contains the wrong address +- may want to generate cert for nginx +- will need to modify nginx server_name +- update /etc/rsyncd.conf hosts allow +- cannot find how to push user is chroot jailed +- merlin service should be copied to systemd +- create playbook to add a new project? \ No newline at end of file diff --git a/libvirt/README.md b/libvirt/README.md index 8ce23d6..3604c2d 100644 --- a/libvirt/README.md +++ b/libvirt/README.md @@ -1,5 +1,9 @@ ## Installation + +--- + ### Prerequisites (debian) + Install QEMU and KVM ``` $ apt install --no-install-recommends qemu-system libvirt-clients libvirt-daemon-system @@ -23,7 +27,10 @@ virt-viewer ``` $ pacman -S qemu libvirt virt-install virt-viewer ansible ``` -### Running the Playbook +## Running the Playbook + +--- + Run the playbook from one directory down ``` ansible-playbook libvirt/main.yml @@ -36,29 +43,12 @@ If vm is on a remote machine ``` virt-viewer --connect qemu+ssh://user@X.X.X.X/system mirror ``` -### Troubleshooting -``` -net.ipv4.ip_forward = 1 -``` -``` -modprobe kvm_intel -``` -If running in `/root` may need to edit config -``` -# edit /etc/libvirt/qemu.conf -user = "root" -group = "root" -$ service restart libvirtd -``` -### Installing Ubuntu -user: local -password: password -TODO: add the rest of the images +--- - +Follow the steps under [Installing Ubuntu](#installing-ubuntu) before continuing -can just press enter for can't remove cdrom +--- container may stop so will need to start with ``` @@ -81,4 +71,86 @@ $ apt update && apt upgrade $ apt install git ansible $ git clone https://git.csclub.uwaterloo.ca/public/mirror-env.git ``` -then enter `mirror-env/mirror` and use the instructions listed there \ No newline at end of file +then enter `mirror-env/mirror` and use the instructions listed there +## Troubleshooting + +--- + +``` +net.ipv4.ip_forward = 1 +``` +``` +modprobe kvm_intel +``` +If running in `/root` may need to edit config +``` +# edit /etc/libvirt/qemu.conf +user = "root" +group = "root" +$ service restart libvirtd +``` +## Installing Ubuntu +--- + +- user: local +- password: password + +Note: the resulting system created from following these steps should look like this: + +``` +$ lsblk +NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT +loop0 7:0 0 55.4M 1 loop /snap/core18/2128 +loop1 7:1 0 32.3M 1 loop /snap/snapd/12704 +loop2 7:2 0 70.3M 1 loop /snap/lxd/21029 +loop3 7:3 0 32.3M 1 loop /snap/snapd/13170 +loop4 7:4 0 61.8M 1 loop /snap/core20/1081 +loop5 7:5 0 67.3M 1 loop /snap/lxd/21545 +sr0 11:0 1 1024M 0 rom +vda 252:0 0 10G 0 disk +├─vda1 252:1 0 512M 0 part /boot/efi +└─vda2 252:2 0 9.5G 0 part + └─md0 9:0 0 9.5G 0 raid1 + └─vg0-root 253:0 0 9.5G 0 lvm / +vdb 252:16 0 10G 0 disk +├─vdb1 252:17 0 512M 0 part +└─vdb2 252:18 0 9.5G 0 part + └─md0 9:0 0 9.5G 0 raid1 + └─vg0-root 253:0 0 9.5G 0 lvm / +vdc 252:32 0 10G 0 disk +vdd 252:48 0 10G 0 disk +vde 252:64 0 10G 0 disk +vdf 252:80 0 10G 0 disk +``` + + + + + + + + + + + + + + + + + + +Create a new user with +- username: local +- password: password + + + + + + +You can ignore this error and just press enter + + + +Now you go back to [Running the Playbook](#running-the-playbook) \ No newline at end of file diff --git a/roles/ftp/tasks/main.yml b/roles/ftp/tasks/main.yml index 009bfb4..ff5b759 100644 --- a/roles/ftp/tasks/main.yml +++ b/roles/ftp/tasks/main.yml @@ -10,7 +10,6 @@ name: proftpd state: started -# proftpd requires modules (how to install ?) - name: copy over config files copy: src: "{{ role_path }}/templates/{{ item.src }}" @@ -20,7 +19,6 @@ mode: "{{ item.mode }}" loop: - { src: blacklist.dat, dest: blacklist.dat, mode: "644" } -# - { src: dhparams.pem, dest: dhparams.pem, mode: "644" } - { src: ldap.conf, dest: ldap.conf, mode: "600" } - { src: modules.conf, dest: modules.conf, mode: "644" } - { src: proftpd.conf, dest: proftpd.conf, mode: "644" } @@ -29,7 +27,7 @@ - { src: virtuals.conf, dest: virtuals.conf, mode: "644" } - name: create dhparams.pem - # not regenerated every playbook run + # will not regenerated every playbook run command: cmd: > openssl dhparam diff --git a/roles/mirror/templates/cron/csc-mirror b/roles/mirror/templates/cron/csc-mirror index 29d8813..33c0989 100644 --- a/roles/mirror/templates/cron/csc-mirror +++ b/roles/mirror/templates/cron/csc-mirror @@ -1,27 +1,30 @@ -# /etc/cron.d/csc-mirror: mirror cron jobs - +# # /etc/cron.d/csc-mirror: mirror cron jobs +# # MAILTO=ztseguin@csclub.uwaterloo.ca - -# m h dom mon dow user command - -# reprepro incoming -*/10 * * * * root /srv/debian/bin/rrr-incoming cron - -# reprepro mirroring -5 */4 * * * root /srv/debian/bin/rrr-update cron - -# regenerate mirror index at 5:40 am on 14th & 28th of every month -# feel free to run this manually if you've added or removed an -# archive or some such thing -# -# Documented here: http://wiki.csclub.uwaterloo.ca/Mirror#Index -# -# ztseguin - temporarilly disabled until script can be updated to handle symlink farm -# 40 5 */14 * * mirror cd /home/mirror/mirror-index && /home/mirror/mirror-index/make-index.py -# 30 3 * * 0 mirror cd /home/mirror/mirror-index && /home/mirror/mirror-index/make-index.py - -# Update index hourly -0 * * * * mirror cd /home/mirror/mirror-index && /home/mirror/mirror-index/make-index.py - -0 * * * * mirror /home/mirror/bin/zfssync csclub >/home/mirror/merlin/logs/zfssync-csclub 2>/dev/null -0 * * * * mirror /home/mirror/bin/zfssync wics >/home/mirror/merlin/logs/zfssync-wics 2>/dev/null +# +# # m h dom mon dow user command +# +# # UPS Health +# * * * * * mirror /usr/bin/flock -w 0 /tmp/ups-status.lock /bin/bash -c "/usr/local/bin/ups-status >/mirror/root/ups 2>/dev/null" 2>/dev/null +# +# # reprepro incoming +# */10 * * * * root /srv/debian/bin/rrr-incoming cron +# +# # reprepro mirroring +# 5 */4 * * * root /srv/debian/bin/rrr-update cron +# +# # regenerate mirror index at 5:40 am on 14th & 28th of every month +# # feel free to run this manually if you've added or removed an +# # archive or some such thing +# # +# # Documented here: http://wiki.csclub.uwaterloo.ca/Mirror#Index +# # +# # ztseguin - temporarilly disabled until script can be updated to handle symlink farm +# # 40 5 */14 * * mirror cd /home/mirror/mirror-index && /home/mirror/mirror-index/make-index.py +# # 30 3 * * 0 mirror cd /home/mirror/mirror-index && /home/mirror/mirror-index/make-index.py +# +# # Update index hourly +# 0 * * * * mirror cd /home/mirror/mirror-index && /home/mirror/mirror-index/make-index.py +# +# 0 * * * * mirror /home/mirror/bin/zfssync csclub >/home/mirror/merlin/logs/zfssync-csclub 2>/dev/null +# 0 * * * * mirror /home/mirror/bin/zfssync wics >/home/mirror/merlin/logs/zfssync-wics 2>/dev/null \ No newline at end of file