run ansible-lint through pre-commit
pre-commit / pre-commit (pull_request) Successful in 4m7s Details
pre-commit / pre-commit (push) Successful in 4m31s Details

precommit-hooks
Tudor Roman 2024-01-28 17:46:42 +01:00
parent 248c711267
commit cfd22425fa
Signed by: tudor
SSH Key Fingerprint: SHA256:3CwS9plgXBecpXImPGxDIaSktUXBejbV/zerZMqzzBk
3 changed files with 11 additions and 19 deletions

5
ansible.cfg Normal file
View File

@ -0,0 +1,5 @@
[defaults]
playbooks_path = ./ansible/playbooks
roles_path = ./ansible/roles
inventory = ./ansible/hosts.yml
pipelining = true

View File

@ -1,4 +0,0 @@
[defaults]
roles_path = ./roles
inventory = ./hosts.yml
pipelining = true

View File

@ -220,22 +220,13 @@
alejandra.enable = true;
statix.enable = true;
deadnix.enable = true;
ansible-lint = {
enable = true;
};
};
settings.ansible-lint = {
subdir = "ansible";
};
};
ansible-lint = pkgs.stdenvNoCC.mkDerivation {
name = "run-ansible-lint";
src = ./.;
dontBuild = true;
doCheck = true;
buildInputs = with pkgs; [ansible-lint git];
checkPhase = ''
cd ./ansible
env "HOME=$TMPDIR" ansible-lint --offline
'';
installPhase = ''
mkdir "$out"
'';
};
};
};