bugfix: dotfiles - stash (#141)

bugfix: dotfiles - stash

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Reviewed-on: mg/ansible#141
Co-Authored-By: mg <mg@noreply.git.mgrote.net>
Co-Committed-By: mg <mg@noreply.git.mgrote.net>
This commit is contained in:
Michael Grote 2021-07-01 17:37:02 +02:00
parent d06110a9ce
commit 406d4becad

View file

@ -5,11 +5,18 @@
name: acl
state: present
- name: check if repo exists
stat:
path: "{{ dotfiles_repo_path }}"
register: repo_exists
- name: stash changes
ansible.builtin.shell: git stash
args:
chdir: "{{ dotfiles_repo_path }}"
changed_when: false
when: repo_exists.stat.exists == true
register: stashed
- name: Ensure dotfiles repository is cloned locally.
git:
@ -23,6 +30,7 @@
args:
chdir: "{{ dotfiles_repo_path }}"
changed_when: false
when: stashed.changed
- name: set owner recursive for repo
file: