runbooks-ansible/.gitlab-ci.yml
2026-01-29 11:38:53 +00:00

39 lines
785 B
YAML

spec:
inputs:
SCRIPT:
description: "Select which Ansible playbook to run."
options:
- ''
- 'base'
default: ''
type: string
---
variables:
# SCRIPT:
# value: "base"
# description: "Select which Ansible playbook to run."
# options:
# - "base"
ANSIBLE_CONFIG: "$CI_PROJECT_DIR/ansible.cfg"
stages:
- script
ansible-base:
stage: script
variables:
DEBIAN_FRONTEND: noninteractive
image:
name: registry.durp.info/ubuntu:latest
before_script:
- apt update && apt install tzdata ansible python3-pip -y
- eval $(ssh-agent -s)
- chmod 400 "$SSH_PRIVATE_KEY"
- ssh-add "$SSH_PRIVATE_KEY"
script:
- ansible-playbook $CI_PROJECT_DIR/ansible/base.yaml
rules:
- if: '$SCRIPT == "base"'