feat: Add pre-commit
Signed-off-by: Julien Riou <julien@riou.xyz>
This commit is contained in:
parent
7b2b1b8329
commit
0063f2157c
7 changed files with 30 additions and 7 deletions
15
.github/workflows/pre-commit.yml
vendored
Normal file
15
.github/workflows/pre-commit.yml
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
---
|
||||||
|
name: pre-commit
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
pre-commit:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: actions/setup-python@v3
|
||||||
|
- uses: pre-commit/action@v3.0.1
|
9
.pre-commit-config.yaml
Normal file
9
.pre-commit-config.yaml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v4.6.0
|
||||||
|
hooks:
|
||||||
|
- id: check-yaml
|
||||||
|
- id: detect-private-key
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: trailing-whitespace
|
|
@ -44,7 +44,7 @@ sub dump_sqlite3
|
||||||
sub setup_env_pgsql
|
sub setup_env_pgsql
|
||||||
{
|
{
|
||||||
my %args = @_;
|
my %args = @_;
|
||||||
my $username = getpwuid $ENV{'UID'};
|
my $username = getpwuid $ENV{'UID'};
|
||||||
umask(0077);
|
umask(0077);
|
||||||
|
|
||||||
if ($args{db_address}) {
|
if ($args{db_address}) {
|
||||||
|
@ -93,7 +93,7 @@ sub setup_env_mysql
|
||||||
my %args = @_;
|
my %args = @_;
|
||||||
umask(0077);
|
umask(0077);
|
||||||
unlink("$wd/.my.cnf");
|
unlink("$wd/.my.cnf");
|
||||||
open(MY, ">$wd/.my.cnf")
|
open(MY, ">$wd/.my.cnf")
|
||||||
or die "Can't open $wd/.my.cnf for writing $@";
|
or die "Can't open $wd/.my.cnf for writing $@";
|
||||||
|
|
||||||
$args{db_address} = $args{db_address} || "localhost";
|
$args{db_address} = $args{db_address} || "localhost";
|
||||||
|
|
|
@ -20,5 +20,5 @@ Alias /nagios4 /usr/share/nagios4/htdocs
|
||||||
</DirectoryMatch>
|
</DirectoryMatch>
|
||||||
|
|
||||||
<Directory /usr/share/nagios4/htdocs>
|
<Directory /usr/share/nagios4/htdocs>
|
||||||
Options +ExecCGI
|
Options +ExecCGI
|
||||||
</Directory>
|
</Directory>
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
comment: allow ping from the world
|
comment: allow ping from the world
|
||||||
|
|
||||||
- name: Deny input connections by default
|
- name: Deny input connections by default
|
||||||
ansible.builtin.iptables:
|
ansible.builtin.iptables:
|
||||||
chain: INPUT
|
chain: INPUT
|
||||||
policy: DROP
|
policy: DROP
|
||||||
|
|
||||||
|
@ -60,4 +60,4 @@
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: Save iptables
|
- name: Save iptables
|
||||||
ansible.builtin.command: netfilter-persistent save
|
ansible.builtin.command: netfilter-persistent save
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
dest: /opt/nagios-plugin-bacula
|
dest: /opt/nagios-plugin-bacula
|
||||||
|
|
||||||
- name: Copy global configuration
|
- name: Copy global configuration
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: files/nagios/nagios.cfg
|
src: files/nagios/nagios.cfg
|
||||||
dest: /etc/nagios4/nagios.cfg
|
dest: /etc/nagios4/nagios.cfg
|
||||||
|
|
||||||
|
|
|
@ -3,4 +3,3 @@
|
||||||
{% for command in nrpe_commands | default([]) %}
|
{% for command in nrpe_commands | default([]) %}
|
||||||
command[{{ command['name'] }}]={{ command['line'] }}
|
command[{{ command['name'] }}]={{ command['line'] }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue