style 💎: Improve Ansible playbook formatting and readability
Refactored the `tasks/preparing.yml` file to improve its structure, readability, and consistency with best practices. This includes updating variable names, adding whitespace, and standardizing indentation.
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
ansible.builtin.file:
|
||||
path: /etc/resolv.conf
|
||||
state: absent
|
||||
when: ''/run/systemd/resolve' in ansible_facts.lsb.description | default('')'
|
||||
when: "'/run/systemd/resolve' in ansible_facts.lsb.description | default('')"
|
||||
|
||||
- name: Create static /etc/resolv.conf
|
||||
ansible.builtin.copy:
|
||||
@@ -88,7 +88,7 @@
|
||||
|
||||
- name: Collect existing directories
|
||||
ansible.builtin.set_fact:
|
||||
valid_dirs: '{{ existing_dirs.results | selectattr('matched', '>', 0) | map(attribute='files') | sum(start=[]) | map(attribute='path') | list }}'
|
||||
valid_dirs: "{{ existing_dirs.results | selectattr('matched', '>', 0) | map(attribute='files') | sum(start=[]) | map(attribute='path') | list }}"
|
||||
|
||||
- name: Find *.tdb and *.ldb files
|
||||
ansible.builtin.find:
|
||||
@@ -103,10 +103,10 @@
|
||||
ansible.builtin.file:
|
||||
path: '{{ item.path }}'
|
||||
state: absent
|
||||
loop: '{{ db_files.results | map(attribute='files') | sum(start=[]) }}'
|
||||
loop: "{{ db_files.results | map(attribute='files') | sum(start=[]) }}"
|
||||
when: item.path is defined
|
||||
|
||||
- name: Report removed files
|
||||
ansible.builtin.debug:
|
||||
msg: 'Removed: {{ item.path }}'
|
||||
loop: '{{ db_files.results | map(attribute='files') | sum(start=[]) }}'
|
||||
loop: "{{ db_files.results | map(attribute='files') | sum(start=[]) }}"
|
||||
Reference in New Issue
Block a user