2024-09-26 10:16:03 +00:00
|
|
|
- name: Clean deprecated configuration
|
|
|
|
hosts: all
|
|
|
|
gather_facts: no
|
|
|
|
tasks:
|
|
|
|
- name: Delete awx-user
|
2024-09-26 10:50:51 +00:00
|
|
|
user:
|
2024-09-26 10:16:03 +00:00
|
|
|
name: awx-user
|
|
|
|
state: absent
|
|
|
|
remove: yes
|
2024-09-26 11:49:23 +00:00
|
|
|
tags: awx
|
2024-09-26 10:16:03 +00:00
|
|
|
- name: Delete awx-user sudoers file
|
|
|
|
file:
|
|
|
|
path: /etc/sudoers.d/awx-user
|
|
|
|
state: absent
|
2024-09-26 11:49:23 +00:00
|
|
|
tags: awx
|
2024-09-26 10:50:51 +00:00
|
|
|
- name: Delete old MOTD configuration
|
|
|
|
file:
|
|
|
|
path: /etc/profile.d/mymotd.sh
|
|
|
|
state: absent
|
2024-09-26 11:49:23 +00:00
|
|
|
tags: motd
|
2024-09-26 10:50:51 +00:00
|
|
|
- name: Delete old Ansible bashrc configuration
|
|
|
|
blockinfile:
|
|
|
|
path: /root/.bashrc
|
|
|
|
marker_begin: 'BEGIN ANSIBLE MANAGED BLOCK'
|
|
|
|
marker_end: 'END ANSIBLE MANAGED BLOCK'
|
|
|
|
marker: "# {mark}"
|
|
|
|
state: absent
|
2024-09-26 11:49:23 +00:00
|
|
|
tags: bashrc
|
2024-09-26 10:50:51 +00:00
|
|
|
- name: Delete old custom bashrc configuration
|
|
|
|
replace:
|
|
|
|
path: /root/.bashrc
|
2024-09-26 11:49:23 +00:00
|
|
|
regexp: '{{ start_delimiter }}\\s\\S*?{{ end_delimiter }}'
|
2024-09-26 10:50:51 +00:00
|
|
|
replace: ''
|
|
|
|
vars:
|
|
|
|
start_delimiter: '### 4Loo'
|
|
|
|
end_delimiter: 'esac'
|