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

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