mirror of
https://gitlab.com/s3lph/ansible-collection-dirvish
synced 2024-11-13 04:44:15 +01:00
52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
|
---
|
||
|
|
||
|
- name: create /etc/dirvish directory
|
||
|
file:
|
||
|
path: "{{ dirvish_server_master_conf | dirname }}"
|
||
|
state: directory
|
||
|
mode: "0755"
|
||
|
owner: root
|
||
|
group: root
|
||
|
|
||
|
- name: render dirvish master config
|
||
|
template:
|
||
|
src: master.conf.j2
|
||
|
dest: "{{ dirvish_server_master_conf }}"
|
||
|
mode: "0644"
|
||
|
owner: root
|
||
|
group: root
|
||
|
|
||
|
# ansible_mounts is broken - https://github.com/ansible/ansible/issues/24644
|
||
|
- name: get all mounts
|
||
|
shell: "cat /etc/mtab | cut -d' ' -f2" # noqa 306
|
||
|
changed_when: no
|
||
|
check_mode: no
|
||
|
register: dirvish_server_register_mtab
|
||
|
|
||
|
- name: make sure all banks are mounted
|
||
|
assert:
|
||
|
that: "item in mounts"
|
||
|
loop: "{{ dirvish_server_bank_mounts }}"
|
||
|
vars:
|
||
|
mounts: "{{ dirvish_server_register_mtab.stdout_lines }}"
|
||
|
|
||
|
- name: create all client directories
|
||
|
file:
|
||
|
path: "{{ hostvars[item].dirvish_server_bank }}/{{ item }}/dirvish"
|
||
|
state: directory
|
||
|
loop: "{{ groups[dirvish_server_clients_group] }}"
|
||
|
|
||
|
- name: render all client configs
|
||
|
template:
|
||
|
src: client_default.conf.j2
|
||
|
dest: "{{ hostvars[item].dirvish_server_bank }}/{{ item }}/dirvish/default.conf"
|
||
|
loop: "{{ groups[dirvish_server_clients_group] }}"
|
||
|
|
||
|
- name: render dirvish crontab
|
||
|
template:
|
||
|
src: dirvish.crontab.j2
|
||
|
dest: "{{ dirvish_server_cronjob }}"
|
||
|
mode: "0755"
|
||
|
owner: root
|
||
|
group: root
|