| 1 |
- name: Ensure target directory exists |
| 2 |
file: |
| 3 |
path: "{{ stage_dir }}/etc/powerdns" |
| 4 |
state: directory |
| 5 |
|
| 6 |
- name: Find pdns config files |
| 7 |
find: |
| 8 |
path: /etc/powerdns |
| 9 |
file_type: any |
| 10 |
register: pdns_configs |
| 11 |
|
| 12 |
- name: Dereference pdns4 configs |
| 13 |
stat: |
| 14 |
path: "{{ item.path }}" |
| 15 |
with_items: "{{ pdns_configs.files }}" |
| 16 |
register: pdns_configs_deref |
| 17 |
|
| 18 |
- name: Link configurations |
| 19 |
file: |
| 20 |
src: "{{ item.stat.lnk_source | default(item.stat.path) }}" |
| 21 |
dest: "{{ stage_dir }}/etc/powerdns/{{ item.stat.path | basename }}" |
| 22 |
state: hard |
| 23 |
with_items: "{{ pdns_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 pdns journal |
| 35 |
become: true |
| 36 |
shell: |
| 37 |
cmd: | |
| 38 |
journalctl -o short-precise --unit pdns > {{ stage_dir }}/logs/pdns.txt.gz |