forked from evolix/ansible-roles
etc-git: purge old .git/index.lock (default: True)
This commit is contained in:
parent
3fcb79a3a3
commit
73efee9caa
|
@ -15,6 +15,7 @@ The **patch** part changes incrementally at each release.
|
|||
* Preliminary support for Debian 11 « Bullseye »
|
||||
* apache: new variable for mpm mode (+ updated default config accordingly)
|
||||
* certbot: add script for manual deploy hooks execution
|
||||
* etc-git: purge old .git/index.lock (default: True)
|
||||
* evolinux-base: install molly-guard by default
|
||||
* generate-ldif: detect hardware raid card
|
||||
* generate-ldif: detect mdadm
|
||||
|
|
|
@ -2,3 +2,5 @@
|
|||
commit_message: Ansible run
|
||||
|
||||
etc_git_monitor_status: True
|
||||
etc_git_purge_index_lock_enabled: True
|
||||
etc_git_purge_index_lock_age: 86400
|
||||
|
|
|
@ -5,6 +5,20 @@
|
|||
name: remount-usr
|
||||
when: git_folder is match('/usr/.*')
|
||||
|
||||
- name: "stat {{ git_folder }}/.git/index.lock"
|
||||
stat:
|
||||
path: "{{ git_folder }}/.git/index.lock"
|
||||
register: _index_lock
|
||||
|
||||
- name: index file is removed if old enough
|
||||
file:
|
||||
path: "{{ git_folder }}/.git/index.lock"
|
||||
state: absent
|
||||
when:
|
||||
- _index_lock.stat.exists
|
||||
- _index_lock.stat.mtime | int <= ((ansible_date_time.epoch | int) - etc_git_purge_index_lock_age | default(86400))
|
||||
- etc_git_purge_index_lock_enabled
|
||||
|
||||
- name: "is {{ git_folder }} clean?"
|
||||
command: git status --porcelain
|
||||
args:
|
||||
|
|
Loading…
Reference in a new issue