feature ansible 0.0045
Some checks failed
Build Docker / build (push) Has been cancelled

This commit is contained in:
2026-03-01 02:34:28 +03:00
parent 9729df0fb2
commit 7b4f17ae79
7 changed files with 54 additions and 1 deletions

3
.gitignore vendored
View File

@@ -24,4 +24,5 @@ hint.py
*.env *.env
#db #db
*.db *.db
versions/ versions/
data/

23
ansible/deploy.yml Normal file
View File

@@ -0,0 +1,23 @@
- hosts: servers
become: yes
tasks:
- name: Install Docker
shell: curl -fsSL https://get.docker.com | sh
args:
creates: /usr/bin/docker
- name: Install git
apt:
name: git
state: present
update_cache: yes
- name: Clone repo
git:
repo: ${GITEA_INSTANCE_URL} //как то передавать переменные
dest: /opt/infra
- name: Start docker compose
shell: docker compose up -d
args:
chdir: /opt/infra

3
ansible/env_example Normal file
View File

@@ -0,0 +1,3 @@
ansible-playbook -i inventory.ini deploy.yml -e "target_host=$HOST"
GITEA_INSTANCE_URL="..."
HOST="..."

2
ansible/inventory.ini Normal file
View File

@@ -0,0 +1,2 @@
[servers]
myserver ansible_user=root

View File

@@ -0,0 +1,9 @@
# Dockerfile.runner
FROM node:20-bullseye
# Устанавливаем зависимости
RUN apt-get update && apt-get install -y \
curl \
ansible \
&& rm -rf /var/lib/apt/lists/*
# Проверка версий
RUN node -v && npm -v && ansible --version

View File

@@ -0,0 +1,12 @@
services:
runner:
image: gitea/act_runner:latest
restart: always
volumes:
- ./data/act_runner:/data
- /var/run/docker.sock:/var/run/docker.sock
environment:
- GITEA_INSTANCE_URL=${GITEA_INSTANCE_URL}
- GITEA_RUNNER_REGISTRATION_TOKEN=${TOKEN}
- GITEA_RUNNER_NAME=docker-runner
- GITEA_RUNNER_LABELS=node-docker:docker://homyakspace/wedding:${TAG}, node-ansible:docker://homyakspace/wedding-ansible:${TAG}

View File

@@ -0,0 +1,3 @@
TOKEN="..."
GITEA_INSTANCE_URL="..."
TAG="amd64" # amd64 / latest [arm64]