Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Ansible
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Code
Merge requests
2
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nounous
Ansible
Commits
ff864b50
Commit
ff864b50
authored
4 years ago
by
Benjamin Graillot
Browse files
Options
Downloads
Patches
Plain Diff
Better header
Updates according to file rather than repository
parent
52d0d6eb
No related branches found
Branches containing commit
No related tags found
1 merge request
!211
Header
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
group_vars/all/vars.yaml
+6
-2
6 additions, 2 deletions
group_vars/all/vars.yaml
with
6 additions
and
2 deletions
group_vars/all/vars.yaml
+
6
−
2
View file @
ff864b50
---
---
# Custom header
# Custom header
dirty
:
"
{
{lookup('pipe',
'git
diff
--quiet
||
echo
dirty')}
}"
dirty
:
"
{
%
if
template_path
is
defined
%}{{
lookup('pipe',
'git
diff
--quiet
--
'
+
template_path
|
quote
+
'
||
echo
dirty')
}}{%
else
%}{{
lookup('pipe',
'git
diff
--quiet
||
echo
dirty')
}}{%
endif
%
}"
ansible_header
:
|
ansible_header
:
|
+++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++
Ansible managed, don't modify the file locally.
Ansible managed, don't modify the file locally.
See https://gitlab.crans.org/nounous/ansible.
See https://gitlab.crans.org/nounous/ansible.
{% if template_path is defined %}{% set _, rpath = template_path.split('roles/', 1) %}Commit: {% if dirty %}({{dirty}}) {% endif %}{{ lookup('pipe', 'git log -n 1 --pretty=format:%H -- ' + template_path | quote) }}
{% if dirty %}Run by: {{ ansible_env.SUDO_USER }}
{% else %}Author: {{ lookup('pipe', 'git log -n 1 --pretty=format:%an -- ' + template_path | quote) }}
{% endif %}Template: roles/{{ rpath }}
{% else %}
Run by: {{ ansible_env.SUDO_USER }}
Run by: {{ ansible_env.SUDO_USER }}
Latest commit: {% if dirty %}({{dirty}}) {% endif %}{{ lookup('pipe', 'git rev-parse HEAD') }}
Latest commit: {% if dirty %}({{dirty}}) {% endif %}{{ lookup('pipe', 'git rev-parse HEAD') }}
{% if template_path is defined %}{% set _, rpath = template_path.split('roles/') %}Template: roles/{{ rpath }}
{% endif %}
{% endif %}
+++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment