diff --git a/mirror/main.yml b/mirror/main.yml index c1909cb..49fb581 100644 --- a/mirror/main.yml +++ b/mirror/main.yml @@ -14,11 +14,11 @@ when: hostname.stdout != "mirror" - name: run the system role first - include_role: + include_role: name: "../roles/system" - name: run mirror system role second - include_role: + include_role: name: "../roles/mirror" - name: run the rest of the roles diff --git a/roles/mirror/tasks/main.yml b/roles/mirror/tasks/main.yml index bb3503d..81fc636 100644 --- a/roles/mirror/tasks/main.yml +++ b/roles/mirror/tasks/main.yml @@ -1,3 +1,14 @@ +- name: install python3-pip + apt: + name: python3-pip + state: present + update_cache: yes + +- name: install weir (for zfssync) + pip: + name: weir + executable: pip3 + - name: copy cron job copy: src: "{{ role_path }}/templates/cron/csc-mirror" @@ -21,7 +32,7 @@ mode: preserve - name: copy files for /mirror/root - copy: + copy: src: "{{ role_path }}/templates/root/root/" dest: /mirror/root owner: root @@ -84,7 +95,7 @@ - name: create first merlin.sock symlink # noqa deprecated-command-syntax # need chdir to create relative symlinks - command: + command: cmd: "ln -s run/merlin.sock merlin.sock" chdir: "/mirror/merlin" creates: "/mirror/merlin/merlin.sock" diff --git a/roles/system/tasks/main.yml b/roles/system/tasks/main.yml index c6b0dc3..0671f79 100755 --- a/roles/system/tasks/main.yml +++ b/roles/system/tasks/main.yml @@ -76,9 +76,9 @@ # create the var using # vars: # disks: -# - /dev/vdc -# - /dev/vdd -# - /dev/vde +# - /dev/vdc +# - /dev/vdd +# - /dev/vde # - /dev/vdf # disk_arg: "{{ disks | join(' ') }}" @@ -87,9 +87,9 @@ - name: disks to be used for zpool set_fact: disks: - - /dev/vdc - - /dev/vdd - - /dev/vde + - /dev/vdc + - /dev/vdd + - /dev/vde - /dev/vdf - name: join disk pathes onto one line @@ -104,9 +104,9 @@ - name: create and mount zpool command: > - zpool create - -m /mirror/root/.cscmirror - cscmirror - raidz2 + zpool create + -m /mirror/root/.cscmirror + cscmirror + raidz2 {{ disk_arg }} when: zpool_exists.rc != 0