21 lines
572 B
YAML
21 lines
572 B
YAML
---
|
|
# tasks file for log
|
|
- name: "get sha of latest commit"
|
|
ansible.builtin.git:
|
|
repo: "https://infra.opendoor.fr/git/tom/{{ myrole_name }}"
|
|
clone: no
|
|
update: no
|
|
dest: /tmp/foobar
|
|
register: repo_info
|
|
delegate_to: localhost
|
|
|
|
- debug:
|
|
msg: "{{ repo_info.after | regex_search( '[0-9a-zA-Z]{7}' ) }}"
|
|
|
|
- name: "update ansible history"
|
|
ansible.builtin.lineinfile:
|
|
path: /etc/history
|
|
create: true
|
|
line: "{{ '%Y-%m-%d' | strftime }} {{ myrole_name }} {{ repo_info.after | regex_search( '[0-9a-zA-Z]{6}' ) }}"
|
|
tags: always,changelog
|