Moved playbooks here; zsh dotfiles distro; new config logs
This commit is contained in:
@@ -5,8 +5,33 @@
|
||||
recurse: yes
|
||||
register: pacnew_files
|
||||
|
||||
- name: Ensure pacnew.logs directory exists locally
|
||||
ansible.builtin.file:
|
||||
path: "{{ playbook_dir }}/pacnew.logs"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
delegate_to: localhost
|
||||
run_once: true
|
||||
become: no
|
||||
|
||||
- name: Save .pacnew list to file
|
||||
ansible.builtin.copy:
|
||||
content: "{{ pacnew_files.files | map(attribute='path') | join('\n') }}\n"
|
||||
dest: "{{ playbook_dir }}/pacnew.logs/{{ inventory_hostname }}.pacnew"
|
||||
mode: '0644'
|
||||
delegate_to: localhost
|
||||
become: no
|
||||
when: pacnew_files.matched > 0
|
||||
|
||||
- name: Clean up old .pacnew list file if no .pacnew files exist
|
||||
ansible.builtin.file:
|
||||
path: "{{ playbook_dir }}/pacnew.logs/{{ inventory_hostname }}.pacnew"
|
||||
state: absent
|
||||
delegate_to: localhost
|
||||
become: no
|
||||
when: pacnew_files.matched == 0
|
||||
|
||||
- name: Alert if .pacnew files exist
|
||||
ansible.builtin.debug:
|
||||
msg: "Warning: The following .pacnew files require merging: {{ pacnew_files.files | map(attribute='path') | list }}"
|
||||
when: pacnew_files.matched > 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user