Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)); \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
Expand Down
12 changes: 11 additions & 1 deletion scripts/install-ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
Loading