From a6fe0397a680c4a6a9d42ad17c5da2012f32d6d9 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Tue, 5 Oct 2021 14:31:53 +0200 Subject: [PATCH] etc-git: back to 2 tasks for each commit "test X && git commit" generates a failure and a lot of noise. --- etc-git/tasks/commit.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/etc-git/tasks/commit.yml b/etc-git/tasks/commit.yml index 2217e45d..f32c6ede 100644 --- a/etc-git/tasks/commit.yml +++ b/etc-git/tasks/commit.yml @@ -8,16 +8,40 @@ force: yes # /etc +- name: Is /etc a git repository + stat: + path: /etc/.git + register: _etc_git + - name: "evocommit /etc" - shell: "test -d /etc/.git && /usr/local/bin/evocommit --repository /etc --message \"{{ commit_message | default(etc_git_default_commit_message) }}\"" + command: "/usr/local/bin/evocommit --repository /etc --message \"{{ commit_message | mandatory }}\"" ignore_errors: yes + when: + - _etc_git.stat.exists + - _etc_git.stat.isdir # /etc/bind +- name: Is /etc/bind a git repository + stat: + path: /etc/bind/.git + register: _etc_bind_git + - name: "evocommit /etc/bind" - shell: "test -d /etc/bind/.git && /usr/local/bin/evocommit --repository /etc/bind --message \"{{ commit_message | default(etc_git_default_commit_message) }}\"" + command: "/usr/local/bin/evocommit --repository /etc/bind --message \"{{ commit_message | mandatory }}\"" ignore_errors: yes + when: + - _etc_bind_git.stat.exists + - _etc_bind_git.stat.isdir # /usr/share/scripts +- name: Is /usr/share/scripts a git repository + stat: + path: /usr/share/scripts/.git + register: _usr_share_scripts_git + - name: "evocommit /usr/share/scripts" - shell: "test -d /usr/share/scripts/.git && /usr/local/bin/evocommit --repository /usr/share/scripts --message \"{{ commit_message | default(etc_git_default_commit_message) }}\"" + command: "/usr/local/bin/evocommit --repository /usr/share/scripts --message \"{{ commit_message | mandatory }}\"" ignore_errors: yes + when: + - _usr_share_scripts_git.stat.exists + - _usr_share_scripts_git.stat.isdir