Add ansible header

Signed-off-by: Yohann D'ANELLO <ynerant@crans.org>
This commit is contained in:
Yohann D'ANELLO 2021-03-17 22:52:05 +01:00
parent be6bc01114
commit 9b0be73500
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
8 changed files with 54 additions and 4 deletions

1
.gitignore vendored
View File

@ -0,0 +1 @@
debug.yml

View File

@ -4,7 +4,8 @@ timeout = 60
# ask_vault_pass = True
[privilege_escalation]
# become_ask_pass = True
become = True
become_ask_pass = True
[ssh_connection]
pipelining = True

View File

@ -1,4 +1,23 @@
---
# Custom header
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 managed, don't modify the file locally.
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 }}
Latest commit: {% if dirty %}({{dirty}}) {% endif %}{{ lookup('pipe', 'git rev-parse HEAD') }}
{% endif %}
+++++++++++++++++++++++++++++++++++++++++++++++++++
pass:
upstream: 'ssh://git@git.ynerant.fr:2222/ynerant/pass'
@ -9,7 +28,7 @@ cliutils:
bogus_dirs: []
git:
email: ynerant@crans.org
name: ynerant
name: Yohann D'ANELLO
signingkey: 3A75C55819C8CF85
bind:
@ -18,5 +37,17 @@ bind:
administrator: ynerant.crans.org
ipv4: 185.230.78.178
ipv6: 2a0c:700:12:0:f21f:afff:fee5:34ca
slave: 51.15.199.212
aliases: []
slave: "" # 51.15.199.212
aliases:
- cloud
- element
- git
- hydrogen
- mailu
- notls
- synapse
- thelounge
- traefik
- translate
- whoami
- www

View File

@ -1,5 +1,7 @@
#!/bin/bash
{{ ansible_header | comment }}
# enable color support of ls and also add handy aliases
if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"

View File

@ -1,3 +1,5 @@
{{ ansible_header | comment }}
[ -z "$PS1" ] && return
HISTCONTROL=ignoredups:ignorespace

View File

@ -1,3 +1,5 @@
{{ ansible_header | comment }}
[user]
email = {{ cliutils.git.email }}
name = {{ cliutils.git.name }}

View File

@ -1 +1,3 @@
{{ ansible_header | comment }}
set mark-symlinked-directories on

View File

@ -1,8 +1,17 @@
{{ ansible_header | comment }}
unbind r
bind r source-file ~/.tmux.conf
set -g mouse on
## set the default TERM
set -g default-terminal screen
## update the TERM variable of terminal emulator when creating a new session or attaching a existing session
set -g update-environment 'DISPLAY SSH_ASKPASS SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY TERM'
## determine if we should enable 256-colour support
if "[[ ${TERM} =~ 256color || ${TERM} == fbterm ]]" 'set -g default-terminal screen-256color'
# use the vim motion keys to move between panes
bind h select-pane -L