From 6a4b250b5d510ca1f059db26ea8e0fba4d6846bf Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Tue, 12 Oct 2021 18:23:50 +0200 Subject: [PATCH] etc-git: better output detection --- etc-git/tasks/commit.yml | 12 +++++++++--- etc-git/tasks/main.yml | 21 ++++++++++++--------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/etc-git/tasks/commit.yml b/etc-git/tasks/commit.yml index 01530b71..3f993771 100644 --- a/etc-git/tasks/commit.yml +++ b/etc-git/tasks/commit.yml @@ -8,7 +8,9 @@ - name: "evocommit /etc" command: "/usr/local/bin/evocommit --ansible --repository /etc --message \"{{ commit_message | mandatory }}\"" - changed_when: "'CHANGED:' in _etc_git_commit.stdout" + changed_when: + - _etc_git_commit.stdout + - "'CHANGED:' in _etc_git_commit.stdout" ignore_errors: yes register: _etc_git_commit when: @@ -23,7 +25,9 @@ - name: "evocommit /etc/bind" command: "/usr/local/bin/evocommit --ansible --repository /etc/bind --message \"{{ commit_message | mandatory }}\"" - changed_when: "'CHANGED:' in _etc_bind_git_commit.stdout" + changed_when: + - _etc_bind_git_commit.stdout + - "'CHANGED:' in _etc_bind_git_commit.stdout" ignore_errors: yes register: _etc_bind_git_commit when: @@ -38,7 +42,9 @@ - name: "evocommit /usr/share/scripts" command: "/usr/local/bin/evocommit --ansible --repository /usr/share/scripts --message \"{{ commit_message | mandatory }}\"" - changed_when: "'CHANGED:' in _usr_share_scripts_git_commit.stdout" + changed_when: + - _usr_share_scripts_git_commit.stdout + - "'CHANGED:' in _usr_share_scripts_git_commit.stdout" ignore_errors: yes register: _usr_share_scripts_git_commit when: diff --git a/etc-git/tasks/main.yml b/etc-git/tasks/main.yml index 90df9f60..11be1899 100644 --- a/etc-git/tasks/main.yml +++ b/etc-git/tasks/main.yml @@ -7,6 +7,18 @@ tags: - etc-git +- include_role: + name: evolix/remount-usr + +- name: "evocommit script is installed" + copy: + src: evocommit + dest: /usr/local/bin/evocommit + mode: "0755" + force: yes + tags: + - etc-git + - include: repository.yml vars: repository_path: "/etc" @@ -32,15 +44,6 @@ - _usr_share_scripts.stat.isdir - ansible_distribution_major_version is version('10', '>=') -- name: "evocommit script is installed" - copy: - src: evocommit - dest: /usr/local/bin/evocommit - mode: "0755" - force: yes - tags: - - etc-git - - name: "etc-git-optimize script is installed" copy: src: etc-git-optimize