parent
adde77eb88
commit
7d6a55e2c8
@ -1,8 +0,0 @@ |
||||
# Mirror |
||||
After setting up the vm this playbook will setup mirror's services |
||||
## Instructions |
||||
Install ansible then run the playbook |
||||
``` |
||||
apt install -y ansible |
||||
ansible-playbook main.yml |
||||
``` |
@ -1,58 +0,0 @@ |
||||
--- |
||||
# https://wiki.csclub.uwaterloo.ca/Mirror |
||||
# |
||||
# may want to split this into multiple files |
||||
# |
||||
# right now we will just take configs from mirror |
||||
# later we will edit them as required |
||||
# |
||||
# user should running this as root:root |
||||
# so unsure if need to set owner:group for files/dirs |
||||
# |
||||
# unsure that hosts does |
||||
- hosts: 127.0.0.1 |
||||
tasks: |
||||
- name: install dependencies |
||||
apt: |
||||
pkg: |
||||
- zfsutils-linux |
||||
- rsync |
||||
- nginx |
||||
- proftpd |
||||
state: latest |
||||
update_cache: true |
||||
state: started |
||||
- name: create zfs mountpoint |
||||
file: |
||||
path: /mirror/root/.cscmirror |
||||
state: directory |
||||
owner: root |
||||
group: root |
||||
mode: 0777 |
||||
recurse: yes |
||||
- name: create and mount zpool |
||||
# double check this works (and produces the correct result) |
||||
# may be better to use the /dev/disk/by-id/... instead |
||||
commmand: zpool create -f -m /mirror/root/.cscmirror cscmirror raidz2 /dev/vdc /dev/vdd /dev/vde /dev/vdf |
||||
# may need to mount it (also check that it will automount on boot) |
||||
# zfs mount -a |
||||
- name: enable and start rsync daemon |
||||
systemd: |
||||
name: rsync |
||||
enabled: true |
||||
state: started |
||||
- name: add rsync config |
||||
template: |
||||
src: rsync/rsyncd.conf.j2 |
||||
dest: /etc/rsyncd.conf |
||||
owner: root |
||||
group: root |
||||
mode: 0644 |
||||
template: |
||||
src: rsync/rsyncd-filter.conf.j2 |
||||
dest: /etc/rsyncd-filter.conf |
||||
owner: root |
||||
group: root |
||||
mode: 0644 |
||||
notify: restart rsync |
||||
|
@ -0,0 +1,2 @@ |
||||
[defaults] |
||||
inventory = hosts |
@ -0,0 +1,7 @@ |
||||
ubuntu@localhost |
||||
|
||||
[all:vars] |
||||
ansible_connection=ssh |
||||
ansible_port=7777 |
||||
ansible_user=ubuntu |
||||
ansible_password=ubuntu |
@ -0,0 +1,7 @@ |
||||
--- |
||||
- hosts: all |
||||
become: true |
||||
roles: |
||||
- setup |
||||
- zfs |
||||
- rsync |
@ -0,0 +1,20 @@ |
||||
- name: enable and start rsync daemon |
||||
systemd: |
||||
name: rsync |
||||
enabled: true |
||||
state: started |
||||
|
||||
- name: add rsync config |
||||
template: |
||||
src: ../templates/rsyncd.conf.j2 |
||||
dest: /etc/rsyncd.conf |
||||
owner: root |
||||
group: root |
||||
mode: 0644 |
||||
template: |
||||
src: ../templates/rsyncd-filter.conf.j2 |
||||
dest: /etc/rsyncd-filter.conf |
||||
owner: root |
||||
group: root |
||||
mode: 0644 |
||||
notify: restart rsync |
@ -0,0 +1,9 @@ |
||||
- name: install dependencies |
||||
apt: |
||||
pkg: |
||||
- zfsutils-linux |
||||
- rsync |
||||
- nginx |
||||
- proftpd |
||||
state: latest |
||||
update_cache: true |
@ -0,0 +1,15 @@ |
||||
- name: create zfs mountpoint |
||||
file: |
||||
path: /mirror/root/.cscmirror |
||||
state: directory |
||||
owner: root |
||||
group: root |
||||
mode: 0777 |
||||
recurse: yes |
||||
|
||||
- name: create and mount zpool |
||||
# double check this works (and produces the correct result) |
||||
# may be better to use the /dev/disk/by-id/... instead |
||||
commmand: zpool create -f -m /mirror/root/.cscmirror cscmirror raidz2 /dev/vdc /dev/vdd /dev/vde /dev/vdf |
||||
# may need to mount it (also check that it will automount on boot) |
||||
# zfs mount -a |
Loading…
Reference in new issue