From 3f647cfd5cf3a60fd34bbc143a66882fbbf3c478 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 26 Sep 2024 12:50:51 +0200 Subject: [PATCH] refs #8025 clean: tags added, added task to remove old bashrc config --- playbooks/clean.yml | 25 ++++++++++++++++++++++++- roles/debian-base/tasks/vim.yml | 2 +- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/playbooks/clean.yml b/playbooks/clean.yml index 1e2b2bc..f5c8d90 100644 --- a/playbooks/clean.yml +++ b/playbooks/clean.yml @@ -3,11 +3,34 @@ gather_facts: no tasks: - name: Delete awx-user - ansible.builtin.user: + user: name: awx-user state: absent remove: yes + tags: [awx] - name: Delete awx-user sudoers file file: path: /etc/sudoers.d/awx-user state: absent + tags: [awx] + - name: Delete old MOTD configuration + file: + path: /etc/profile.d/mymotd.sh + state: absent + tags: [motd] + - 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 + tags: [bashrc] + - name: Delete old custom bashrc configuration + replace: + path: /root/.bashrc + regexp: '{{ start_delimiter }}[\\s\\S]*?{{ end_delimiter }}' + replace: '' + vars: + start_delimiter: '### 4Loo' + end_delimiter: 'esac' diff --git a/roles/debian-base/tasks/vim.yml b/roles/debian-base/tasks/vim.yml index 3b4a32a..d89ef6f 100644 --- a/roles/debian-base/tasks/vim.yml +++ b/roles/debian-base/tasks/vim.yml @@ -1,4 +1,4 @@ -- name: Install packages +- name: Install vim packages apt: name: vim state: present