CI: avoid vault requirement in lint/tests
Some checks failed
CI / skip-ci-check (pull_request) Successful in 1m17s
CI / lint-and-test (pull_request) Successful in 1m22s
CI / ansible-validation (pull_request) Failing after 2m48s
CI / secret-scanning (pull_request) Successful in 1m19s
CI / dependency-scan (pull_request) Successful in 1m24s
CI / sast-scan (pull_request) Successful in 2m34s
CI / license-check (pull_request) Failing after 1m22s
CI / vault-check (pull_request) Failing after 2m20s
CI / playbook-test (pull_request) Failing after 2m19s
CI / container-scan (pull_request) Successful in 1m50s
CI / sonar-analysis (pull_request) Failing after 1m16s
CI / workflow-summary (pull_request) Successful in 1m16s
Some checks failed
CI / skip-ci-check (pull_request) Successful in 1m17s
CI / lint-and-test (pull_request) Successful in 1m22s
CI / ansible-validation (pull_request) Failing after 2m48s
CI / secret-scanning (pull_request) Successful in 1m19s
CI / dependency-scan (pull_request) Successful in 1m24s
CI / sast-scan (pull_request) Successful in 2m34s
CI / license-check (pull_request) Failing after 1m22s
CI / vault-check (pull_request) Failing after 2m20s
CI / playbook-test (pull_request) Failing after 2m19s
CI / container-scan (pull_request) Successful in 1m50s
CI / sonar-analysis (pull_request) Failing after 1m16s
CI / workflow-summary (pull_request) Successful in 1m16s
This commit is contained in:
parent
e0996642bc
commit
0322279ab0
@ -96,6 +96,31 @@ jobs:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Configure CI Ansible (no vault, localhost inventory)
|
||||
run: |
|
||||
set -e
|
||||
cat > /tmp/ci-inventory.ini <<'EOF'
|
||||
[all]
|
||||
localhost ansible_connection=local
|
||||
EOF
|
||||
|
||||
cat > /tmp/ci-ansible.cfg <<'EOF'
|
||||
[defaults]
|
||||
inventory = /tmp/ci-inventory.ini
|
||||
roles_path = roles
|
||||
host_key_checking = False
|
||||
stdout_callback = yaml
|
||||
bin_ansible_callbacks = True
|
||||
retry_files_enabled = False
|
||||
interpreter_python = auto_silent
|
||||
forks = 10
|
||||
pipelining = True
|
||||
EOF
|
||||
|
||||
echo "ANSIBLE_CONFIG=/tmp/ci-ansible.cfg" >> "$GITHUB_ENV"
|
||||
echo "ANSIBLE_INVENTORY=/tmp/ci-inventory.ini" >> "$GITHUB_ENV"
|
||||
echo "ANSIBLE_VAULT_PASSWORD_FILE=/dev/null" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Install Python and dependencies
|
||||
run: |
|
||||
apt-get update && apt-get install -y python3 python3-pip
|
||||
@ -304,21 +329,9 @@ jobs:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Python and dependencies
|
||||
run: |
|
||||
apt-get update && apt-get install -y python3 python3-pip
|
||||
|
||||
- name: Install Ansible
|
||||
run: pip3 install --no-cache-dir ansible
|
||||
|
||||
- name: Install Ansible collections
|
||||
run: |
|
||||
ansible-galaxy collection install -r collections/requirements.yml
|
||||
|
||||
- name: Validate playbooks (CI inventory, no vault)
|
||||
- name: Configure CI Ansible (no vault, localhost inventory)
|
||||
run: |
|
||||
set -e
|
||||
echo "Validating playbooks against a CI-only localhost inventory (no vault required)..."
|
||||
cat > /tmp/ci-inventory.ini <<'EOF'
|
||||
[dev]
|
||||
localhost ansible_connection=local
|
||||
@ -342,6 +355,38 @@ jobs:
|
||||
localhost ansible_connection=local
|
||||
EOF
|
||||
|
||||
cat > /tmp/ci-ansible.cfg <<'EOF'
|
||||
[defaults]
|
||||
inventory = /tmp/ci-inventory.ini
|
||||
roles_path = roles
|
||||
host_key_checking = False
|
||||
stdout_callback = yaml
|
||||
bin_ansible_callbacks = True
|
||||
retry_files_enabled = False
|
||||
interpreter_python = auto_silent
|
||||
forks = 10
|
||||
pipelining = True
|
||||
EOF
|
||||
|
||||
echo "ANSIBLE_CONFIG=/tmp/ci-ansible.cfg" >> "$GITHUB_ENV"
|
||||
echo "ANSIBLE_INVENTORY=/tmp/ci-inventory.ini" >> "$GITHUB_ENV"
|
||||
echo "ANSIBLE_VAULT_PASSWORD_FILE=/dev/null" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Install Python and dependencies
|
||||
run: |
|
||||
apt-get update && apt-get install -y python3 python3-pip
|
||||
|
||||
- name: Install Ansible
|
||||
run: pip3 install --no-cache-dir ansible
|
||||
|
||||
- name: Install Ansible collections
|
||||
run: |
|
||||
ansible-galaxy collection install -r collections/requirements.yml
|
||||
|
||||
- name: Validate playbooks (CI inventory, no vault)
|
||||
run: |
|
||||
set -e
|
||||
echo "Validating playbooks against a CI-only localhost inventory (no vault required)..."
|
||||
failed=0
|
||||
for playbook in playbooks/*.yml site.yml configure_app.yml provision_vms.yml; do
|
||||
[ -f "$playbook" ] || continue
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user