Jérémy Lecour
ee21973371
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|2777|524|2253|2462|:+1:
Reference build: <a href="https://jenkins.evolix.org/job/gitea/job/ansible-roles/job/unstable/223//ansiblelint">Evolix » ansible-roles » unstable #223</a>
gitea/ansible-roles/pipeline/head This commit looks good
Fully Qualified Collection Name
93 lines
2.3 KiB
YAML
93 lines
2.3 KiB
YAML
---
|
|
|
|
- ansible.builtin.include_role:
|
|
name: evolix/remount-usr
|
|
tags:
|
|
- etc-git
|
|
|
|
- name: "evocommit script is installed"
|
|
ansible.builtin.copy:
|
|
src: evocommit
|
|
dest: /usr/local/bin/evocommit
|
|
mode: "0755"
|
|
force: yes
|
|
tags:
|
|
- etc-git
|
|
|
|
- name: "ansible-commit script is installed"
|
|
ansible.builtin.copy:
|
|
src: ansible-commit
|
|
dest: /usr/local/bin/ansible-commit
|
|
mode: "0755"
|
|
force: yes
|
|
tags:
|
|
- etc-git
|
|
|
|
- name: "etc-git-optimize script is installed"
|
|
ansible.builtin.copy:
|
|
src: etc-git-optimize
|
|
dest: /usr/share/scripts/etc-git-optimize
|
|
mode: "0755"
|
|
force: yes
|
|
tags:
|
|
- etc-git
|
|
|
|
- name: "etc-git-status script is installed"
|
|
ansible.builtin.copy:
|
|
src: etc-git-status
|
|
dest: /usr/share/scripts/etc-git-status
|
|
mode: "0755"
|
|
force: yes
|
|
tags:
|
|
- etc-git
|
|
|
|
- name: Check if cron is installed
|
|
ansible.builtin.shell:
|
|
cmd: "set -o pipefail && dpkg -l cron 2>/dev/null | grep -q -E '^(i|h)i'"
|
|
executable: /bin/bash
|
|
failed_when: False
|
|
changed_when: False
|
|
check_mode: no
|
|
register: is_cron_installed
|
|
|
|
- block:
|
|
- name: Legacy cron jobs for /etc/.git status are absent
|
|
ansible.builtin.file:
|
|
dest: "{{ item }}"
|
|
state: absent
|
|
loop:
|
|
- /etc/cron.monthly/optimize-etc-git
|
|
- /etc/cron.d/etc-git-status
|
|
|
|
- name: Cron job for monthly git optimization
|
|
ansible.builtin.cron:
|
|
name: "Monthly optimization"
|
|
cron_file: etc-git
|
|
special_time: "monthly"
|
|
user: root
|
|
job: "/usr/share/scripts/etc-git-optimize"
|
|
|
|
- name: Cron job for hourly git status
|
|
ansible.builtin.cron:
|
|
name: "Hourly warning for unclean Git repository if nobody is connected"
|
|
cron_file: etc-git
|
|
special_time: "hourly"
|
|
user: root
|
|
job: "who > /dev/null || /usr/share/scripts/etc-git-status"
|
|
state: "{{ etc_git_monitor_status | bool | ternary('present','absent') }}"
|
|
|
|
- name: Cron job for daily git status
|
|
ansible.builtin.cron:
|
|
name: "Daily warning for unclean Git repository"
|
|
cron_file: etc-git
|
|
user: root
|
|
job: "/usr/share/scripts/etc-git-status"
|
|
minute: "21"
|
|
hour: "21"
|
|
weekday: "*"
|
|
day: "*"
|
|
month: "*"
|
|
state: "{{ etc_git_monitor_status | bool | ternary('present','absent') }}"
|
|
when: is_cron_installed.rc == 0
|
|
tags:
|
|
- etc-git |