replace manual versionning with latest commit id and url from git

This commit is contained in:
2023-10-12 13:20:07 +02:00
parent f434a6a6d4
commit 09297a857d

View File

@@ -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