From 09297a857da9b3eefad48ba3764da7fb71c9be95 Mon Sep 17 00:00:00 2001 From: Thomas Constans Date: Thu, 12 Oct 2023 13:20:07 +0200 Subject: [PATCH] replace manual versionning with latest commit id and url from git --- tasks/main.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index d94496e..bae8964 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,7 +1,17 @@ --- # tasks file for log +- git: + repo: "ssh://git@infra.opendoor.fr/tom/{{ myrole_name }}" + update: no + clone: no + dest: /srv/repo + delegate_to: localhost + remote_user: tom + become: false + register: repo_info + - lineinfile: path: /etc/history create: true - line: "{{ '%Y-%m-%d' | strftime }} {{ myrole_name }} {{ role_version }}" + line: "{{ '%Y-%m-%d' | strftime }} {{ myrole_name }} {{ repo_info.after | regex_search( '[a-zA-Z0-9]{7}') }} https://infra.opendoor.fr/git/tom/{{ myrole_name }}/commit/{{ repo_info.after }}" tags: always,changelog