From f4f973327c4abb0f005fc39a5b7a901d53fd7e1f Mon Sep 17 00:00:00 2001 From: Andrew Wang Date: Tue, 28 Sep 2021 00:02:19 -0400 Subject: [PATCH] small update --- libvirt/README.md | 22 ++++++++++++++-------- libvirt/main.yml | 6 +++--- roles/README.md | 26 -------------------------- roles/ftp/tasks/main.yml | 2 +- 4 files changed, 18 insertions(+), 38 deletions(-) diff --git a/libvirt/README.md b/libvirt/README.md index a7aecd6..12fd10c 100644 --- a/libvirt/README.md +++ b/libvirt/README.md @@ -1,13 +1,19 @@ -then service libvirtd restart - -adduser libvirt -adduser -aG libvirt - -To create the vm run the command +## Installation ``` -ansible-playbook main.yml +ansible-playbook libvirt/main.yml ``` - +Then connect to the created vm using virt-viewer +``` +virt-viewer --domain-name mirror +``` +If vm is on a remote machine +``` +virt-viewer --connect qemu+ssh://user@X.X.X.X/system mirror +``` +## TODO +for now just have a folder of screenshots +- change name of lvm volume from "lv0-root" to just "root" +troubleshooting: ignore "failed to unmount /cdrom" and just ctrl+c in viewer ## Troubleshooting ``` net.ipv4.ip_forward = 1 ? diff --git a/libvirt/main.yml b/libvirt/main.yml index d88c9d2..1a7eced 100644 --- a/libvirt/main.yml +++ b/libvirt/main.yml @@ -23,7 +23,7 @@ - name: create directory for vm file: - path: "{{ playbook_dir }}/vm/disks" + path: "{{ playbook_dir }}/vm" state: directory recurse: yes @@ -66,7 +66,7 @@ - name: create storage pool command: "virsh {{ item }}" loop: - - pool-define-as mirror dir --target="{{ playbook_dir }}/vm/disks" + - pool-define-as mirror dir --target="{{ playbook_dir }}/vm" - pool-build mirror - pool-autostart mirror - pool-start mirror @@ -76,7 +76,7 @@ - name: create virtual disks command: cmd: "virsh vol-create-as mirror {{ item.name }} {{ item.size }}" - creates: "{{ playbook_dir }}/vm/disks/{{ item.name }}" + creates: "{{ playbook_dir }}/vm/{{ item.name }}" loop: - { name: mirror_root1.qcow2, size: 10G } - { name: mirror_root2.qcow2, size: 10G } diff --git a/roles/README.md b/roles/README.md index 97ff825..ad73729 100644 --- a/roles/README.md +++ b/roles/README.md @@ -5,29 +5,3 @@ - add directory_mode to set directory permission - double check src and dest behaviour with trailing / - could check that copy works like rsync -## other info -troubleshooting: try to load the kvm module with `modprobe kvm_intel` - -interface should automatically come up but can also use -$ virt-viewer --domain-name mirror -if vm is on a remote machine -$ virt-viewer --connect qemu+ssh://user@host.example.com/system vmnamehere - -for now just have a folder of screenshots -- change name of lvm volume from "lv0-root" to just "root" -troubleshooting: ignore "failed to unmount /cdrom" and just ctrl+c in viewer - -login into your created user (from install), change to root, and create password for root -$ sudo su -type in your password -$ passwd -create root password - -may already be mounted but just to be sure -$ zfs mount -a - -- mirror hosts - - http://mirror.csclub.uwaterloo.ca (the mirror) - - http://ca.releases.ubuntu.com (ubuntu releases) - - http://ca.ceph.com (ceph releases) - - http://debian.csclub.uwaterloo.ca (csclub's debian packages) diff --git a/roles/ftp/tasks/main.yml b/roles/ftp/tasks/main.yml index e830dce..160be68 100644 --- a/roles/ftp/tasks/main.yml +++ b/roles/ftp/tasks/main.yml @@ -30,7 +30,7 @@ mode: "{{ item.mode }}" loop: - { src: blacklist.dat, dest: blacklist.dat, mode: "644" } - - { src: dhparams.pem, dest: dhparams.pem, 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" }