finalize structure

autoautoinstall
Andrew Wang 1 year ago
parent a15cb4bcd4
commit 884c437e7b
  1. 3
      .gitignore
  2. 2
      hosts
  3. 37
      libvirt/main.yml
  4. 8
      libvirt/templates/user-data
  5. 7
      local/README.md
  6. 19
      roles/README.md
  7. 31
      roles/ftp/tasks/main.yml
  8. 0
      roles/ftp/templates/proftpd.conf
  9. 38
      roles/index/tasks/main.yml
  10. 25
      roles/mirror.txt
  11. 73
      roles/mirror/tasks/main.yml
  12. 0
      roles/mirror/templates/cron/csc-mirror
  13. 0
      roles/mirror/templates/mirror/bin/csc-sync-apache
  14. 0
      roles/mirror/templates/mirror/bin/csc-sync-archlinux
  15. 0
      roles/mirror/templates/mirror/bin/csc-sync-archlinux-old
  16. 0
      roles/mirror/templates/mirror/bin/csc-sync-badperms
  17. 0
      roles/mirror/templates/mirror/bin/csc-sync-cdimage
  18. 0
      roles/mirror/templates/mirror/bin/csc-sync-ceph
  19. 0
      roles/mirror/templates/mirror/bin/csc-sync-chmod
  20. 0
      roles/mirror/templates/mirror/bin/csc-sync-debian
  21. 0
      roles/mirror/templates/mirror/bin/csc-sync-debian-cd
  22. 0
      roles/mirror/templates/mirror/bin/csc-sync-gentoo
  23. 0
      roles/mirror/templates/mirror/bin/csc-sync-s3
  24. 0
      roles/mirror/templates/mirror/bin/csc-sync-ssh
  25. 0
      roles/mirror/templates/mirror/bin/csc-sync-standard
  26. 0
      roles/mirror/templates/mirror/bin/csc-sync-standard-ipv6
  27. 0
      roles/mirror/templates/mirror/bin/csc-sync-wget
  28. 0
      roles/mirror/templates/mirror/bin/make-torrents
  29. 0
      roles/mirror/templates/mirror/bin/report_mirror
  30. 0
      roles/mirror/templates/mirror/bin/ubuntu-releases-sync
  31. 0
      roles/mirror/templates/mirror/bin/zfssync
  32. 0
      roles/mirror/templates/mirror/config/ADDRESS
  33. 0
      roles/mirror/templates/mirror/config/ADDRESS_V6
  34. 0
      roles/mirror/templates/mirror/debian/.bash_logout
  35. 0
      roles/mirror/templates/mirror/debian/.bash_profile
  36. 0
      roles/mirror/templates/mirror/debian/.bashrc
  37. 0
      roles/mirror/templates/mirror/debian/README
  38. 0
      roles/mirror/templates/mirror/debian/bin/dircombine
  39. 0
      roles/mirror/templates/mirror/debian/bin/ftpsync
  40. 0
      roles/mirror/templates/mirror/debian/bin/pushpdo
  41. 0
      roles/mirror/templates/mirror/debian/bin/runmirrors
  42. 0
      roles/mirror/templates/mirror/debian/bin/typicalsync
  43. 0
      roles/mirror/templates/mirror/debian/bin/udh
  44. 0
      roles/mirror/templates/mirror/debian/bin/websync
  45. 0
      roles/mirror/templates/mirror/debian/etc/common
  46. 0
      roles/mirror/templates/mirror/debian/etc/ftpsync.conf
  47. 0
      roles/mirror/templates/mirror/debian/etc/ftpsync.conf.sample
  48. 0
      roles/mirror/templates/mirror/debian/etc/pushpdo.conf.sample
  49. 0
      roles/mirror/templates/mirror/debian/etc/pushpdo.mirror.sample
  50. 0
      roles/mirror/templates/mirror/debian/etc/runmirrors.conf.sample
  51. 0
      roles/mirror/templates/mirror/debian/etc/runmirrors.mirror.sample
  52. 0
      roles/mirror/templates/mirror/debian/etc/secrets/.dummy
  53. 0
      roles/mirror/templates/mirror/debian/etc/websync.conf.sample
  54. 0
      roles/mirror/templates/mirror/debian/mirrorcheck/bin/dmc-archive.pl
  55. 0
      roles/mirror/templates/mirror/debian/mirrorcheck/bin/dmc.pl
  56. 0
      roles/mirror/templates/mirror/debian/mirrorcheck/www/.dummy
  57. 0
      roles/mirror/templates/mirror/foooooooo
  58. 0
      roles/mirror/templates/mirror/git_old/include/FOOTER.shtml
  59. 0
      roles/mirror/templates/mirror/git_old/include/HEADER.shtml
  60. 0
      roles/mirror/templates/mirror/git_old/include/default.css
  61. 0
      roles/mirror/templates/mirror/git_old/include/favicon.ico
  62. 0
      roles/mirror/templates/mirror/git_old/include/header.png
  63. 0
      roles/mirror/templates/mirror/git_old/include/motd.msg
  64. 0
      roles/mirror/templates/mirror/git_old/include/robots.txt
  65. 0
      roles/mirror/templates/mirror/git_old/misc/debian-check-md5sum
  66. 0
      roles/mirror/templates/mirror/git_old/routing/csc-mirror
  67. 0
      roles/mirror/templates/mirror/git_old/routing/interfaces
  68. 0
      roles/mirror/templates/mirror/git_old/routing/orionroutes.py
  69. 0
      roles/mirror/templates/mirror/git_old/routing/rt_realms
  70. 0
      roles/mirror/templates/mirror/git_old/routing/rt_tables
  71. 0
      roles/mirror/templates/mirror/git_old/routing/update-orion-routes
  72. 0
      roles/mirror/templates/mirror/git_old/rrdtool/mirror-nl-glue.c
  73. 0
      roles/mirror/templates/mirror/git_old/rrdtool/mirror-nl-glue.h
  74. 0
      roles/mirror/templates/mirror/git_old/rrdtool/mirror-rrd.c
  75. 0
      roles/mirror/templates/mirror/git_old/rrdtool/rrdgraph-monthly.sh
  76. 0
      roles/mirror/templates/mirror/git_old/rrdtool/rrdgraph-yearly.sh
  77. 0
      roles/mirror/templates/mirror/git_old/rrdtool/rrdgraph.sh
  78. 0
      roles/mirror/templates/mirror/git_old/snmp/.gitignore
  79. 0
      roles/mirror/templates/mirror/git_old/snmp/CSC-MIB.txt
  80. 0
      roles/mirror/templates/mirror/git_old/snmp/Makefile
  81. 0
      roles/mirror/templates/mirror/git_old/snmp/csc-snmp-subagent.c
  82. 0
      roles/mirror/templates/mirror/git_old/snmp/mirror-mib.c
  83. 0
      roles/mirror/templates/mirror/git_old/snmp/mirror-mib.h
  84. 0
      roles/mirror/templates/mirror/git_old/snmp/mirror-nl-glue.c
  85. 0
      roles/mirror/templates/mirror/git_old/snmp/mirror-nl-glue.h
  86. 0
      roles/mirror/templates/mirror/git_old/snmp/mirror-stats.c
  87. 0
      roles/mirror/templates/mirror/git_old/snmp/query_mib.sh
  88. 0
      roles/mirror/templates/mirror/git_old/snmp/snmp.conf
  89. 0
      roles/mirror/templates/mirror/git_old/torrents/rtorrent-init.d
  90. 0
      roles/mirror/templates/mirror/git_old/torrents/rtorrent.rc
  91. 0
      roles/mirror/templates/mirror/index.html__
  92. 0
      roles/mirror/templates/mirror/merlin/.gitignore
  93. 0
      roles/mirror/templates/mirror/merlin/arthur.py
  94. 0
      roles/mirror/templates/mirror/merlin/init-script
  95. 0
      roles/mirror/templates/mirror/merlin/merlin.py
  96. 0
      roles/mirror/templates/mirror/merlin/merlin.service
  97. 0
      roles/mirror/templates/mirror/merlin/rebuild.sh
  98. 0
      roles/mirror/templates/mirror/merlin/test.py
  99. 0
      roles/mirror/templates/mirror/merlin/test/debianBased
  100. 0
      roles/mirror/templates/mirror/merlin/test/debian_update
  101. Some files were not shown because too many files have changed in this diff Show More

3
.gitignore vendored

@ -1,3 +0,0 @@
*.iso
disks/

@ -1,3 +1,5 @@
# I will move this to the hosts.yml soon
[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
# ansible_ssh_private_key_file

@ -45,7 +45,6 @@
{{ playbook_dir }}/templates/user-data
creates: "{{ playbook_dir }}/vm/seed.qcow2"
# get user to set net.ipv4.ip_forward = 1 ?
- name: create mirbr0 bridge network
command: "virsh {{ item }}"
loop:
@ -95,6 +94,8 @@
--graphics vnc,port=5911,listen=127.0.0.1
--noautoconsole
when: not vm_exists.rc == 0
# get user to set net.ipv4.ip_forward = 1 ?
# in the vm to disable cloud-init run
# sudo touch /etc/cloud/cloud-init.disabled
@ -102,22 +103,22 @@
# copy over pub key into /root/.ssh/authorized_keys
# add line to ssh config that allows ssh as root
# possible that this will not be run in order?
- name: setup mirror vm
hosts: 192.168.123.2
tasks:
- name: setup system
import_role:
name: "../roles/system"
# roles are called relative to playbook
# - name: setup mirror services
# hosts: 192.168.123.2
# include_role: "../roles/{{ item }}"
# loop:
# - zfs (make sure runs first)
# - index
# - nginx
# - rsync
# - ftp
- name: setup mirror
import_role:
name: "../roles/mirror"
# to write
# - could be combined into one
# - merlin
# - scripts (in bin)
# - mirrormanager
# - users
- name: setup other services
import_role:
name: "../roles/{{ item }}"
loop:
- ftp
- nginx
- rsync
# - mirrormanager

@ -3,10 +3,12 @@ autoinstall:
version: 1
identity:
hostname: mirror
username: ubuntu
username: local
# mkpasswd --method=SHA-512 --rounds=4096
# password is just ubuntu
password: "$6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0"
# password is krb5
password: "$6$rounds=4096$FfXwns8mexFJUAjS$z/ERS/5gitnl8f3AZnnztS8iFpmS/AtzUfEVM2.tfRpWnl/y7PwhDZTeT68WxoogmSTgaZyVL6..jP4aiB1LD0"
# this password is ubuntu
# $6$exDY1mhS4KUYCE/2$zmn9ToZwTKLhCw.b4/b.ZRTIZM30JZ4QrOQ2aOXJ8yk96xpcCof0kxKwuX1kqLG/ygbJ1f8wxED22bTL4F46P0
locale: en_US
ssh:
allow-pw: true

@ -0,0 +1,7 @@
# local playbook
this playbook will be run inside a already set up vm to set up the services
used if someone wants to set up vm themselves + wants more disks in the pool
includes varable for which disks to turn into a zfs pool

@ -21,3 +21,22 @@ check wiki for more details
### Sync Scripts
add sync scripts to `~mirror/bin`
merge all mirror stuff into mirror role
setup role that creates zpools and users
# to write
- ftp
- mirror
- setup
- local
# to update
- hosts + ansible.cfg
- group_vars
- quote the file mode (0777 -> '0777')
- add directory_mode to set directory permission
- double check src and dest behaviour with trailing /
- could check that copy works like rsync

@ -0,0 +1,31 @@
- name: install proftpd
apt:
name: proftpd
state: present
update_cache: yes
# make `/mirror/root` dir
# will this overwrite the /mirror/root/include ?
# double check perms
# proftpd requires modules (how to install ?)
- name: Copy assets
copy:
src: "{{ role_path }}/templates/proftpd.conf"
dest: /etc/proftpd/proftpd.conf
# owner: root
# group: root
# mode: 0755
# also need to get
# /etc/proftpd/blacklist.dat (binary)
# /etc/proftpd/dhparams.pem (maybe not)
# /etc/proftpd/ldap.conf (unable to read)
# /etc/proftpd/modules.conf (and maybe everything in /usr/lib/proftpd/)
# /etc/proftpd/sql.conf (unable to read)
# /etc/proftpd/tls.conf
# /etc/proftpd/virtuals.conf

@ -1,38 +0,0 @@
---
- name: copy over crond job
copy:
src: "{{ role_path }}/templates/csc-mirror"
dest: /etc/cron.d/csc-mirror
owner: root
group: root
mode: 0644
# restart cron
# create mirror home dir in user role
# - name: mirror home
# file:
# path: /home/mirror
# state: directory
# owner: mirror
# group: mirror
# mode: 0755
# recurse: yes
# user template module instead
# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/template_module.html
- name: Copy index files
copy:
src: "{{ role_path }}/templates/mirror-index"
dest: /home/mirror/mirror-index
owner: mirror
group: mirror
mode: 0775
- name: Copy assets
copy:
src: "{{ role_path }}/templates/include"
dest: /mirror/root/include
owner: root
group: csc-mirror
mode: 0755

@ -0,0 +1,25 @@
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)

@ -0,0 +1,73 @@
# setup will folders and users for us to use here
# merlin will create
# /mirror/merlin/run + run/merlin.sock
# do we need to create ln -s from /mirror/merlin/run/merlin.sock to /mirror/merlin/merlin.sock
# - name: set up /home/mirror
- name: copy over crond job
copy:
src: "{{ role_path }}/templates/csc-mirror"
dest: /etc/cron.d/csc-mirror
owner: root
group: root
mode: 0644
# restart cron
# create mirror home dir in user role
# - name: mirror home
# file:
# path: /home/mirror
# state: directory
# owner: mirror
# group: mirror
# mode: 0755
# recurse: yes
# also create /mirror/root
- name: Copy index files
copy:
src: "{{ role_path }}/templates/mirror-index"
dest: /home/mirror/mirror-index
owner: mirror
group: mirror
mode: 0775
- name: Copy assets
copy:
src: "{{ role_path }}/templates/include"
dest: /mirror/root/include
owner: root
group: csc-mirror
mode: 0755
# merlin goes goes under /home
# csc-mirror goes under /etc/cron.d
# include and merlin go under /mirror
# delete symlinks and recreate when installing
# the git repo @mirror only update with /home/mirror
# could just rsync whatever is in that repo to /home/mirror
# unable to read files with +s
# - /mirror/merlin/run/merlin.sock
# what the: looks like python will create this
# may need to ln -s from run/merlin.sock to /mirror/merlin/merlin.sock and /home/mirror/merlin/merlin.sock
# for busybox
# ln -s /bin/busybox ls
# then ./ls will execute ls from busybox
# in /mirror/merlin/dev need to create null random urandom with mknod

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save