ansible-roles/roles/pgweb/tasks/conf.yml

21 lines
689 B
YAML

---
- name: List existing bookmarks
shell: ls -1 {{ pgweb_root_dir }}/bookmarks/ | perl -pe 's/\.toml$//'
register: pgweb_current_bookmarks
changed_when: False
tags: pgweb,pg
- name: Remove unmanaged bookmarks
file: path={{ pgweb_root_dir }}/bookmarks/{{ item }}.toml state=absent
loop: "{{ pgweb_current_bookmarks.stdout_lines }}"
when: not item in pgweb_bookmarks | map(attribute='name') | list
notify: restart pgweb
tags: pgweb,pg
- name: Configure bookmarks
template: src=bookmark.toml.j2 dest={{ pgweb_root_dir }}/bookmarks/{{ item.name }}.toml owner=root group={{ pgweb_user }} mode=640
loop: "{{ pgweb_bookmarks }}"
notify: restart pgweb
tags: pgweb,pg