From 07af650388c8c613316996880c7ddb49396b5724 Mon Sep 17 00:00:00 2001 From: vincent Date: Mon, 22 Mar 2021 21:29:09 +0100 Subject: [PATCH] review inventory --- tasks/main.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 2907371..4cb3f1b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -22,6 +22,17 @@ state: present # not required. choices: absent;present. Whether the account should exist or not, taking action if the state is different from what is stated. become: yes +- name: test if user bash rc exist + stat: + path: /home/{{user.name}}/.bashrc + register: links + +- name: delete bashrc if needed + file: + path: "{{ links.stat.path }}" + state: absent + when: links.stat.islnk is defined and not links.stat.islnk + - name: apply stow config shell: stow * args: @@ -33,4 +44,4 @@ args: chdir: /home/{{user.name}}/conf2 when: config_download.changed == true - become: yes \ No newline at end of file + become: yes