software-infrastructure/roles/ericomeehan.save_initial_configuration/tasks/dump_debconf_db.yml
2024-07-03 19:35:21 +00:00

24 lines
642 B
YAML

---
# tasks file for dump_debconf_db
- name: Install debconf-utils
apt:
name: debconf-utils
state: present
- name: Check if /root/preseed.txt exists
stat:
path: /root/preseed.txt
register: preseed_file
- name: Create preseed file
command: echo "#_preseed_V1" > /root/preseed.txt
when: not preseed_file.stat.exists
- name: Append installer's debconf database to the file
command: debconf-get-selections --installer >> /root/preseed.txt
when: not preseed_file.stat.exists
- name: Append debconf database to the file
command: debconf-get-selections >> /root/preseed.txt
when: not preseed_file.stat.exists