blob: 9fded230e16c6d76c8f7d93b433f47a63c9e0eb2 [file] [log] [blame]
Omer61472e12025-04-03 16:15:21 +02001- name: Ensure target directory exists
2 file:
3 path: "{{ stage_dir }}/etc/bind"
4 state: directory
5
6- name: Find bind config files
7 find:
8 path: /etc/bind
9 file_type: any
10 register: bind_configs
11
12- name: Dereference bind configs
13 stat:
14 path: "{{ item.path }}"
15 with_items: "{{ bind_configs.files }}"
16 register: bind_configs_deref
17
18- name: Link configurations
19 file:
20 src: "{{ item.stat.lnk_source | default(item.stat.path) }}"
21 dest: "{{ stage_dir }}/etc/bind/{{ item.stat.path | basename }}"
22 state: hard
23 with_items: "{{ bind_configs_deref.results }}"
24 when: item.stat.isreg or item.stat.islnk
25
26# NOTE(frickler) Copied from devstack role export-devstack-journal
27- name: Ensure {{ stage_dir }}/logs exists
28 become: true
29 file:
30 path: "{{ stage_dir }}/logs"
31 state: directory
32 owner: "{{ ansible_user }}"
33
34- name: Collect bind journal
35 become: true
36 shell:
37 cmd: |
38 journalctl -o short-precise --unit named > {{ stage_dir }}/logs/bind9.txt