summaryrefslogtreecommitdiff
path: root/roles/whawty/auth/store/tasks/main.yml
blob: 86f2691bc5c3f0d7a7ba940493e5b28c6a5d80ae (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
---
- 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"