feat(role): Initial commit
This commit is contained in:
15
tasks/delete_unneeded_bash_include_files.yml
Normal file
15
tasks/delete_unneeded_bash_include_files.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
# SPDX-License-Identifier: MIT
|
||||
- name: 'For local account ''{{ local_account }}'' get list of bash include files'
|
||||
changed_when: false
|
||||
register: 'bashcon_canonical_bashrc_includes_actual'
|
||||
ansible.builtin.shell: |
|
||||
ls -1 {% if local_account != 'root' %}/home{% endif %}/{{ local_account }}/.config/bash/bashrc-includes.d
|
||||
|
||||
- name: 'For local account ''{{ local_account }}'' delete unneeded bash include files'
|
||||
when: 'item not in bashcon_canonical_bashrc_includes_desired'
|
||||
loop_control:
|
||||
label: 'If unneeded delete bashrc include file ''{{ item }}'''
|
||||
loop: '{{ bashcon_canonical_bashrc_includes_actual.stdout_lines }}'
|
||||
ansible.builtin.file:
|
||||
path: '{% if local_account != ''root'' %}/home{% endif %}/{{ local_account }}/.config/bash/bashrc-includes.d/{{ item }}'
|
||||
state: 'absent'
|
||||
Reference in New Issue
Block a user