Create a fact with the hash of the latest commit of Ansible repo
parent
f5e33e78fd
commit
acf2ab3d0f
|
@ -0,0 +1,22 @@
|
||||||
|
---
|
||||||
|
- name: get git version
|
||||||
|
shell: git rev-parse HEAD
|
||||||
|
register: git_version
|
||||||
|
delegate_to: 127.0.0.1
|
||||||
|
become: False
|
||||||
|
|
||||||
|
- name: Create local_fact directory
|
||||||
|
file:
|
||||||
|
path: /etc/ansible/facts.d/
|
||||||
|
state: directory
|
||||||
|
|
||||||
|
- name: Create hash.fact file
|
||||||
|
file:
|
||||||
|
path: /etc/ansible/facts.d/hash.fact
|
||||||
|
state: touch
|
||||||
|
|
||||||
|
- name: Update latest commit hash
|
||||||
|
template:
|
||||||
|
src: facts.d/hash.fact.j2
|
||||||
|
dest: /etc/ansible/facts.d/hash.fact
|
||||||
|
mode: 0644
|
|
@ -0,0 +1,2 @@
|
||||||
|
[commit]
|
||||||
|
latest_commit_hash: {{ git_version.stdout }}
|
Loading…
Reference in New Issue