|
|
|
@ -5,9 +5,14 @@ |
|
|
|
|
owner: root |
|
|
|
|
group: root |
|
|
|
|
mode: "0644" |
|
|
|
|
# TODO: start/restart cron |
|
|
|
|
|
|
|
|
|
- name: copy mirror home |
|
|
|
|
- name: restart and enable cron |
|
|
|
|
systemd: |
|
|
|
|
name: cron |
|
|
|
|
state: restarted |
|
|
|
|
enabled: yes |
|
|
|
|
|
|
|
|
|
- name: copy files for /home/mirror |
|
|
|
|
copy: |
|
|
|
|
src: "{{ role_path }}/templates/mirror/" |
|
|
|
|
dest: /home/mirror |
|
|
|
@ -15,21 +20,14 @@ |
|
|
|
|
group: mirror |
|
|
|
|
mode: preserve |
|
|
|
|
|
|
|
|
|
- name: copy include |
|
|
|
|
- name: copy files for /mirror/root |
|
|
|
|
copy: |
|
|
|
|
src: "{{ role_path }}/templates/root/root/include/" |
|
|
|
|
dest: /mirror/root/include |
|
|
|
|
src: "{{ role_path }}/templates/root/root/" |
|
|
|
|
dest: /mirror/root |
|
|
|
|
owner: root |
|
|
|
|
group: csc-mirror |
|
|
|
|
mode: preserve |
|
|
|
|
|
|
|
|
|
- name: create merlin directories |
|
|
|
|
file: |
|
|
|
|
path: /mirror/merlin |
|
|
|
|
owner: root |
|
|
|
|
group: root |
|
|
|
|
mode: "0755" |
|
|
|
|
|
|
|
|
|
- name: create merlin subdirectories |
|
|
|
|
file: |
|
|
|
|
path: "/mirror/merlin/{{ item.file }}" |
|
|
|
@ -37,30 +35,30 @@ |
|
|
|
|
group: "{{ item.owner }}" |
|
|
|
|
mode: "0755" |
|
|
|
|
loop: |
|
|
|
|
- { file: bin, owner: root } |
|
|
|
|
- { file: dev, owner: root } |
|
|
|
|
- { file: bin, owner: root } |
|
|
|
|
- { file: run, owner: mirror } |
|
|
|
|
|
|
|
|
|
- name: copy over arthur and busybox |
|
|
|
|
- name: copy arthur and busybox into merlin |
|
|
|
|
copy: |
|
|
|
|
src: "{{ item.src }}" |
|
|
|
|
dest: "{{ item.dest }}" |
|
|
|
|
dest: "/mirror/merlin/{{ item.dest }}" |
|
|
|
|
owner: root |
|
|
|
|
group: root |
|
|
|
|
mode: "0755" |
|
|
|
|
loop: |
|
|
|
|
- src: "{{ role_path }}/templates/root/merlin/arthur" |
|
|
|
|
dest: "/mirror/merlin/arthur" |
|
|
|
|
dest: "arthur" |
|
|
|
|
- src: "/usr/bin/busybox" |
|
|
|
|
dest: "/mirror/merlin/bin/busybox" |
|
|
|
|
dest: "bin/busybox" |
|
|
|
|
|
|
|
|
|
- name: create symlinks |
|
|
|
|
- name: create symlinks from busybox and arthur |
|
|
|
|
# noqa deprecated-command-syntax |
|
|
|
|
# need chdir to create relative symlinks |
|
|
|
|
command: |
|
|
|
|
cmd: "ln -s {{ item.src }} {{ item.dest }}" |
|
|
|
|
chdir: "/mirror/merlin/run" |
|
|
|
|
creates: "/mirror/merlin/run/{{ item.dest }}" |
|
|
|
|
chdir: "/mirror/merlin/bin" |
|
|
|
|
creates: "/mirror/merlin/bin/{{ item.dest }}" |
|
|
|
|
loop: |
|
|
|
|
- { src: busybox, dest: cd } |
|
|
|
|
- { src: busybox, dest: cp } |
|
|
|
@ -71,12 +69,33 @@ |
|
|
|
|
- { src: busybox, dest: sleep } |
|
|
|
|
- { src: ../arthur, dest: arthur } |
|
|
|
|
|
|
|
|
|
# startup merlin to get |
|
|
|
|
# /mirror/merlin/run/merlin.sock |
|
|
|
|
# then symlink to /mirror/merlin/merlin.sock |
|
|
|
|
# and /home/mirror/merlin/merlin.sock |
|
|
|
|
# https://tldp.org/LDP/lfs/LFS-BOOK-6.1.1-HTML/chapter06/devices.html |
|
|
|
|
- name: create special files |
|
|
|
|
# /dev/(random|urandom) normally has "-m 0444" |
|
|
|
|
# donno why mirror has writable random and urandom |
|
|
|
|
command: |
|
|
|
|
cmd: "mknod -m 0666 /mirror/merlin/dev/{{ item.file }} c 1 {{ item.type }}" |
|
|
|
|
creates: "/mirror/merlin/dev/{{ item.file }}" |
|
|
|
|
loop: |
|
|
|
|
- { type: "3", file: "null" } |
|
|
|
|
- { type: "8", file: "random" } |
|
|
|
|
- { type: "9", file: "urandom" } |
|
|
|
|
|
|
|
|
|
- name: create first merlin.sock symlink |
|
|
|
|
# noqa deprecated-command-syntax |
|
|
|
|
# need chdir to create relative symlinks |
|
|
|
|
command: |
|
|
|
|
cmd: "ln -s run/merlin.sock merlin.sock" |
|
|
|
|
chdir: "/mirror/merlin" |
|
|
|
|
creates: "/mirror/merlin/merlin.sock" |
|
|
|
|
|
|
|
|
|
# in /mirror/merlin/dev need to create null random urandom with mknod |
|
|
|
|
- name: create second merlin.sock symlink |
|
|
|
|
file: |
|
|
|
|
src: "/mirror/merlin/merlin.sock" |
|
|
|
|
dest: "/home/mirror/merlin/merlin.sock" |
|
|
|
|
owner: root |
|
|
|
|
group: root |
|
|
|
|
state: link |
|
|
|
|
|
|
|
|
|
# might not need the root/merlin/(bin|dev|run) and just make the empty dirs |
|
|
|
|
# where does arthur come from? |
|
|
|
|
# TODO: copy over merlin.service and start/enable service |
|
|
|
|
# this will create /mirror/merlin/run/merlin.sock |