mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-04-19 03:33:17 +02:00
21 lines
689 B
YAML
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
|