summaryrefslogtreecommitdiff
path: root/roles/whawty/auth/store/tasks/main.yml
blob: 72fc61b454697332d5101aa95cabb77de6d18d4c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
- name: install rsync
  apt:
    name: rsync
    state: present

- name: make sure config directory exists
  file:
    path: /etc/whawty/auth/
    state: directory

- name: create store base directory
  file:
    path: "{{ whawty_auth_store.config.basedir }}"
    state: directory
    mode: "{{ whawty_auth_store.permissions['dir-mode'] | default(omit) }}"
    owner: "{{ whawty_auth_store.permissions.owner | default(omit) }}"
    group: "{{ whawty_auth_store.permissions.group | default(omit) }}"

- name: generate store config file
  copy:
    content: "{{ whawty_auth_store.config | to_nice_yaml(indent=2) }}"
    dest: "/etc/whawty/auth/store-{{ whawty_auth_store.name }}.yml"
    mode: "{{ whawty_auth_store.permissions['file-mode'] | default(omit) }}"
    owner: "{{ whawty_auth_store.permissions.owner | default(omit) }}"
    group: "{{ whawty_auth_store.permissions.group | default(omit) }}"

- name: configure sync
  when: "'sync' in whawty_auth_store"
  include_tasks: "sync-{{ whawty_auth_store.sync.type }}.yml"