designate/roles/pdns4-logs-conf/tasks/main.yaml
Michael Johnson d1e34d0205 Stop double compressing pdns logs
This patch changes the powerDNS log collection to stop double compressing the log archive. The designate role compressed the log file and the zuul role also compresses the file.
This will allow the powerDNS logs to be directly viewable via the zuul logs page.

Change-Id: Ic86b8637e00525037b1c7735f9909d83397593a2
2022-05-11 21:29:08 +00:00

39 lines
1008 B
YAML

- name: Ensure target directory exists
file:
path: "{{ stage_dir }}/etc/powerdns"
state: directory
- name: Find pdns config files
find:
path: /etc/powerdns
file_type: any
register: pdns_configs
- name: Dereference pdns4 configs
stat:
path: "{{ item.path }}"
with_items: "{{ pdns_configs.files }}"
register: pdns_configs_deref
- name: Link configurations
file:
src: "{{ item.stat.lnk_source | default(item.stat.path) }}"
dest: "{{ stage_dir }}/etc/powerdns/{{ item.stat.path | basename }}"
state: hard
with_items: "{{ pdns_configs_deref.results }}"
when: item.stat.isreg or item.stat.islnk
# NOTE(frickler) Copied from devstack role export-devstack-journal
- name: Ensure {{ stage_dir }}/logs exists
become: true
file:
path: "{{ stage_dir }}/logs"
state: directory
owner: "{{ ansible_user }}"
- name: Collect pdns journal
become: true
shell:
cmd: |
journalctl -o short-precise --unit pdns > {{ stage_dir }}/logs/pdns.txt.gz