diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..59c632c --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..b71a1c8 --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 diff --git a/files/bacula/make_catalog_backup.pl b/files/bacula/make_catalog_backup.pl index 90e1045..c683493 100755 --- a/files/bacula/make_catalog_backup.pl +++ b/files/bacula/make_catalog_backup.pl @@ -44,7 +44,7 @@ sub dump_sqlite3 sub setup_env_pgsql { my %args = @_; - my $username = getpwuid $ENV{'UID'}; + my $username = getpwuid $ENV{'UID'}; umask(0077); if ($args{db_address}) { @@ -93,7 +93,7 @@ sub setup_env_mysql my %args = @_; umask(0077); unlink("$wd/.my.cnf"); - open(MY, ">$wd/.my.cnf") + open(MY, ">$wd/.my.cnf") or die "Can't open $wd/.my.cnf for writing $@"; $args{db_address} = $args{db_address} || "localhost"; diff --git a/files/nagios/apache2.conf b/files/nagios/apache2.conf index e87d3e5..5dc43e2 100644 --- a/files/nagios/apache2.conf +++ b/files/nagios/apache2.conf @@ -20,5 +20,5 @@ Alias /nagios4 /usr/share/nagios4/htdocs - Options +ExecCGI + Options +ExecCGI diff --git a/tasks/iptables.yml b/tasks/iptables.yml index f127180..dc42fcb 100644 --- a/tasks/iptables.yml +++ b/tasks/iptables.yml @@ -21,7 +21,7 @@ comment: allow ping from the world - name: Deny input connections by default - ansible.builtin.iptables: + ansible.builtin.iptables: chain: INPUT policy: DROP @@ -60,4 +60,4 @@ state: latest - name: Save iptables - ansible.builtin.command: netfilter-persistent save + ansible.builtin.command: netfilter-persistent save diff --git a/tasks/nagios.yml b/tasks/nagios.yml index 298bb55..0375a95 100644 --- a/tasks/nagios.yml +++ b/tasks/nagios.yml @@ -59,7 +59,7 @@ dest: /opt/nagios-plugin-bacula - name: Copy global configuration - ansible.builtin.copy: + ansible.builtin.copy: src: files/nagios/nagios.cfg dest: /etc/nagios4/nagios.cfg diff --git a/templates/nrpe/nrpe_local.cfg.j2 b/templates/nrpe/nrpe_local.cfg.j2 index 5d027b5..73c64e8 100644 --- a/templates/nrpe/nrpe_local.cfg.j2 +++ b/templates/nrpe/nrpe_local.cfg.j2 @@ -3,4 +3,3 @@ {% for command in nrpe_commands | default([]) %} command[{{ command['name'] }}]={{ command['line'] }} {% endfor %} -