diff --git a/Makefile b/Makefile index 9aad556..da2c548 100644 --- a/Makefile +++ b/Makefile @@ -527,24 +527,7 @@ _lint: _plugins-load fi; \ if [ -n "$(HAS_ANSIBLE)" ]; then \ ran_languages="$${ran_languages}\"ansible\","; \ - if [ -z "$${ANSIBLE_ROLES_PATH:-}" ]; then \ - for _acfg in ansible.cfg ansible/ansible.cfg; do \ - if [ -f "$$_acfg" ]; then \ - _rdir=$$(grep -E '^\s*roles_path\s*=' "$$_acfg" 2>/dev/null | head -1 | cut -d= -f2 | tr -d ' '); \ - if [ -n "$$_rdir" ]; then \ - _cdir=$$(dirname "$$_acfg"); \ - if [ "$$_cdir" != "." ]; then \ - export ANSIBLE_ROLES_PATH="$$_cdir/$$_rdir"; \ - else \ - export ANSIBLE_ROLES_PATH="$$_rdir"; \ - fi; \ - echo "{\"level\":\"info\",\"msg\":\"auto-detected ANSIBLE_ROLES_PATH=$${ANSIBLE_ROLES_PATH}\",\"language\":\"ansible\"}" >&2; \ - break; \ - fi; \ - fi; \ - done; \ - fi; \ - ansible-lint || { overall_exit=1; failed_languages="$${failed_languages}\"ansible\","; }; \ + run_per_project ansible "ansible-lint" || { overall_exit=1; failed_languages="$${failed_languages}\"ansible\","; }; \ if [ "$(DEVRAIL_FAIL_FAST)" = "1" ] && [ $$overall_exit -ne 0 ]; then \ end_time=$$(date +%s%3N); \ duration=$$((end_time - start_time)); \ diff --git a/README.md b/README.md index b7cbf48..3b76f73 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ test Run validation tests | Python | ruff, bandit, semgrep, pytest, mypy | | Bash | shellcheck, shfmt, bats | | Terraform | tflint, trivy config, checkov, terraform-docs, terraform, terragrunt | -| Ansible | ansible-lint, molecule | +| Ansible | ansible-lint, molecule, openssh-client | | Ruby | rubocop, reek, brakeman, bundler-audit, rspec, sorbet | | Go | golangci-lint, gofumpt, govulncheck, go test | | JavaScript/TS | eslint, prettier, typescript, vitest, npm audit | diff --git a/scripts/install-ansible.sh b/scripts/install-ansible.sh index 06e0459..c781fec 100644 --- a/scripts/install-ansible.sh +++ b/scripts/install-ansible.sh @@ -25,7 +25,7 @@ source "${DEVRAIL_LIB}/platform.sh" if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then log_info "install-ansible.sh — Install Ansible tooling for DevRail" log_info "Usage: bash scripts/install-ansible.sh [--help]" - log_info "Tools: ansible-lint, molecule" + log_info "Tools: ansible-lint, molecule, openssh-client" exit 0 fi @@ -42,6 +42,16 @@ trap cleanup EXIT log_info "Starting Ansible tooling installation" +# Install SSH client (required by ansible-core's default connection plugin) +if command -v ssh &>/dev/null; then + log_info "openssh-client is already installed, skipping" +else + log_info "Installing openssh-client (required for ansible-core SSH transport)" + apt-get update -qq && apt-get install -y -qq --no-install-recommends openssh-client + rm -rf /var/lib/apt/lists/* + log_info "openssh-client installed successfully" +fi + # Ensure pip is available require_cmd "python3" "python3 is required but not found" if ! command -v pip3 &>/dev/null && ! command -v pip &>/dev/null; then