Compare commits

32 Commits

Author SHA1 Message Date
sotos
831ab77fed Update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 29s
CI/CD Pipeline / deploy (push) Has been cancelled
2025-12-19 10:49:45 +01:00
sotos
d1f7bf05ea asd
Some checks failed
CI/CD Pipeline / lint (push) Has been cancelled
CI/CD Pipeline / deploy (push) Successful in 1m28s
2025-12-19 08:00:41 +01:00
sotos
ccc1bfd366 Update
Some checks failed
CI/CD Pipeline / lint (push) Has been cancelled
CI/CD Pipeline / deploy (push) Failing after 41s
2025-12-19 07:58:10 +01:00
sotos
b5e4a462db das
Some checks failed
CI/CD Pipeline / lint (push) Has been cancelled
CI/CD Pipeline / deploy (push) Failing after 1m20s
2025-12-18 15:37:04 +01:00
sotos
4c4b509b90 asd
Some checks failed
CI/CD Pipeline / lint (push) Has been cancelled
CI/CD Pipeline / deploy (push) Failing after 1m20s
2025-12-18 15:33:26 +01:00
sotos
5940099978 asd
Some checks failed
CI/CD Pipeline / lint (push) Failing after 57s
CI/CD Pipeline / deploy (push) Failing after 1m21s
2025-12-18 15:29:47 +01:00
sotos
bb88b190ee update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Successful in 1m24s
2025-12-17 12:14:53 +01:00
sotos
7f100d85d1 update
Some checks failed
CI/CD Pipeline / lint (push) Has been cancelled
CI/CD Pipeline / deploy (push) Successful in 1m15s
2025-12-17 11:35:01 +01:00
sotos
6931df8463 Update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 39s
2025-12-17 11:32:59 +01:00
sotos
a339ad8d9c update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 56s
2025-12-17 11:28:21 +01:00
sotos
a975f69891 Update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 1m23s
2025-12-17 11:13:38 +01:00
sotos
fa8afa87e5 Merge branch 'main' of https://dns.s-martika.com/smartika/Wordpress-Ansible
Some checks failed
CI/CD Pipeline / lint (push) Failing after 19s
CI/CD Pipeline / deploy (push) Failing after 47s
2025-12-17 11:03:39 +01:00
sotos
46582b611d Update 2025-12-17 11:03:08 +01:00
Robert Ose
ddcc2ace6a Merge branch 'main' of https://dns.s-martika.com/smartika/Wordpress-Ansible
Some checks failed
CI/CD Pipeline / lint (push) Failing after 17s
CI/CD Pipeline / deploy (push) Failing after 1m2s
2025-12-17 10:54:08 +01:00
Robert Ose
dc23f3ac69 update 2025-12-17 10:53:59 +01:00
sotos
1e1d4913a8 update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 42s
2025-12-17 10:48:06 +01:00
sotos
4f77663f89 Update 2025-12-17 10:44:03 +01:00
sotos
882a32f2dc Update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 1m29s
2025-12-17 10:33:05 +01:00
sotos
7d8f7d4658 Updtae
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 48s
2025-12-17 10:15:52 +01:00
sotos
6dfca196a2 Update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 19s
CI/CD Pipeline / deploy (push) Failing after 46s
2025-12-17 10:08:53 +01:00
sotos
0600f09f5b Funktionsfähig
Some checks failed
CI/CD Pipeline / lint (push) Failing after 17s
CI/CD Pipeline / deploy (push) Failing after 46s
2025-12-17 09:43:37 +01:00
sotos
90adb34542 update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 47s
2025-12-17 09:33:11 +01:00
sotos
8c871178cc asdf
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 1m4s
2025-12-17 09:24:08 +01:00
sotos
6d4effa607 Funktionsfähig
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 40s
2025-12-17 09:07:26 +01:00
sotos
d2102f88e7 Funktionsfähig
Some checks failed
CI/CD Pipeline / lint (push) Failing after 17s
CI/CD Pipeline / deploy (push) Failing after 40s
2025-12-17 09:02:57 +01:00
sotos
f28f43bdab asdf
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 41s
2025-12-17 09:00:00 +01:00
sotos
2618ea8ec3 Funktionsfähig
Some checks failed
CI/CD Pipeline / lint (push) Failing after 18s
CI/CD Pipeline / deploy (push) Failing after 39s
2025-12-17 08:57:17 +01:00
sotos
c8f490d8aa Update
Some checks failed
CI/CD Pipeline / lint (push) Has been cancelled
CI/CD Pipeline / deploy (push) Failing after 39s
2025-12-17 08:54:14 +01:00
sotos
3108c915c8 Update
Some checks failed
CI/CD Pipeline / lint (push) Failing after 19s
CI/CD Pipeline / deploy (push) Failing after 39s
2025-12-17 08:52:24 +01:00
Robert Ose
7bade2f31e Merge branch 'main' of https://dns.s-martika.com/smartika/Wordpress-Ansible
Some checks failed
CI/CD Pipeline / lint (push) Failing after 17s
CI/CD Pipeline / deploy (push) Failing after 1m8s
2025-12-16 12:34:03 +01:00
Robert Ose
be029575ed Maaa
:erge branch 'main' of https://dns.s-martika.com/smartika/Wordpress-Ansible
2025-12-16 12:33:05 +01:00
Robert Ose
6a49e454a9 fixed 2025-12-16 12:26:21 +01:00
12 changed files with 153 additions and 78 deletions

View File

@@ -1,9 +1,9 @@
--- ---
name: CI/CD Pipeline name: CI/CD Pipeline
on: "on":
push: push:
branches: [main, flip_dev] branches: [main, flip_dev, hannes]
jobs: jobs:
lint: lint:
@@ -38,21 +38,35 @@ jobs:
apt-get update && apt-get install -y python3 python3-pip openssh-client bash git apt-get update && apt-get install -y python3 python3-pip openssh-client bash git
pip3 install --upgrade pip pip3 install --upgrade pip
pip3 install ansible pip3 install ansible
ansible-galaxy collection install community.docker:">=3.5.0"
- name: Setup SSH key with passphrase - name: Setup SSH
shell: bash
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_PASSPHRASE: ${{ secrets.SSH_PASSPHRASE }}
run: | run: |
set -euo pipefail
mkdir -p ~/.ssh mkdir -p ~/.ssh
printf "%s\n" "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
echo "$SSH_PRIVATE_KEY" | tr -d '\r' > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H 213.95.90.157 >> ~/.ssh/known_hosts ssh-keyscan -H 213.95.90.157 >> ~/.ssh/known_hosts
eval "$(ssh-agent -s)" eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa <<< "${{ secrets.SSH_PASSPHRASE }}" if [ -n "${SSH_PASSPHRASE:-}" ]; then
echo "$SSH_PASSPHRASE" | ssh-add ~/.ssh/id_ed25519
else
- name: Run Ansible deployment ssh-add ~/.ssh/id_ed25519
run: |
if [ -n "$SSH_PASSPHRASE" ]; then
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa <<< "$SSH_PASSPHRASE"
fi fi
ansible-playbook -i ansible/inventory.yaml site.yaml
ssh -o BatchMode=yes root@213.95.90.157 true
- name: Run Ansible
run: |
ansible-playbook -i ansible/inventory.yaml site.yaml

View File

@@ -2,3 +2,5 @@
[defaults] [defaults]
inventory = ansible/inventory.yaml inventory = ansible/inventory.yaml
roles_path = ./roles roles_path = ./roles
[ssh_connection]
ssh_args = -o BatchMode=yes -o PreferredAuthentications=publickey

View File

@@ -4,4 +4,3 @@ all:
server1: server1:
ansible_host: 213.95.90.157 ansible_host: 213.95.90.157
ansible_user: root ansible_user: root
ansible_ssh_private_key_file: /Users/sotos/.ssh/id_rsa

View File

@@ -1,24 +1,8 @@
---
- hosts: all - hosts: all
become: true become: true
roles:
- docker/snake
vars: vars:
app_dir: /opt/docker/snake app_dir: /opt/docker/snake
snake_image: dns.s-martika.com/smartika/snake-game:2.0
tasks: roles:
- name: Create app directory - role: docker/snake
file:
path: "{{ app_dir }}"
state: directory
- name: Copy compose file
copy:
src: "{{ playbook_dir }}/roles/docker/snake/files/docker-compose.yaml"
dest: "{{ app_dir }}/docker-compose.yaml"
- name: Start snake container
command: docker compose up -d
args:
chdir: "{{ app_dir }}"

View File

@@ -13,7 +13,7 @@
update_cache: true update_cache: true
- name: Install Docker - name: Install Docker
shell: curl -fsSL https://get.docker.com | sh shell: curl -fsSL https://get.docker.com | bash
args: args:
creates: /usr/bin/docker creates: /usr/bin/docker

View File

@@ -1,21 +1,33 @@
---
- hosts: all - hosts: all
become: true become: true
vars: vars:
monitor_dir: /opt/docker/monitoring monitor_dir: /opt/docker/monitoring
docker_network: monitoring
tasks: tasks:
- name: Create monitoring directory - name: Ensure monitoring directory exists
file: file:
path: "{{ monitor_dir }}" path: "{{ monitor_dir }}"
state: directory state: directory
owner: root
group: root
mode: '0755'
- name: Copy monitoring stack - name: Copy monitoring stack
copy: copy:
src: ../../docker/monitoring/ src: ../../docker/monitoring/
dest: "{{ monitor_dir }}" dest: "{{ monitor_dir }}"
owner: root
group: root
mode: '0755'
- name: Start monitoring - name: Ensure monitoring Docker network exists
command: docker compose up -d docker_network:
args: name: "{{ docker_network }}"
chdir: "{{ monitor_dir }}" state: present
- name: Start monitoring stack
community.docker.docker_compose_v2:
project_src: "{{ monitor_dir }}"
project_name: monitoring
state: present

View File

@@ -0,0 +1,11 @@
- name: Ensure snake_net exists for monitoring
docker_network:
name: snake_net
state: present
- name: Start monitoring stack
community.docker.docker_compose:
project_src: /opt/docker/monitoring
project_name: monitoring
state: present
restarted: true

View File

@@ -3,7 +3,7 @@
gitea_user: smartika gitea_user: smartika
gitea_token: "idNu783r4ub7ZXi" gitea_token: "idNu783r4ub7ZXi"
snake_image: dns.s-martika.com/smartika/snake-game snake_image: dns.s-martika.com/smartika/snake-game:2.0
snake_tag: "1.0" app_dir: /opt/docker/snake
snake_container_name: snake-game snake_container_name: snake-game
snake_port: 8080 snake_port: 8080

View File

@@ -2,8 +2,12 @@
version: "3.8" version: "3.8"
services: services:
snake: snake:
image: dns.s-martika.com/smartika/snake-game:1.0 image: dns.s-martika.com/smartika/snake-game:2.0
container_name: snake-game777 container_name: snake-game777
restart: unless-stopped restart: unless-stopped
ports: ports:
- "8080:80" - "8080:80"
networks:
snake_net:
external: true

View File

@@ -1,22 +1,43 @@
--- ---
- name: Ensure app directory exists
file:
path: "{{ app_dir }}"
state: directory
owner: root
group: root
mode: '0755'
- name: Ensure snake_net exists
docker_network:
name: snake_net
state: present
# Login to private registry
- name: Login to private registry - name: Login to private registry
docker_login: docker_login:
registry_url: dns.s-martika.com registry_url: dns.s-martika.com
username: "{{ gitea_user }}" username: "{{ gitea_user }}"
password: "{{ gitea_token }}" password: "{{ gitea_token }}"
# Pull latest image
- name: Pull snake-game image - name: Pull snake-game image
docker_image: docker_image:
name: dns.s-martika.com/smartika/snake-game name: "{{ snake_image }}"
tag: "1.0"
source: pull source: pull
# Run container
- name: Run snake-game container - name: Run snake-game container
docker_container: docker_container:
name: snake-game name: snake-game
image: dns.s-martika.com/smartika/snake-game:1.0 image: "{{ snake_image }}"
state: started state: started
restart_policy: always restart_policy: unless-stopped
ports: ports:
- "8080:80" - "8080:80" # host port → container port
pull: yes
networks:
- name: snake_net

View File

@@ -1,33 +1,43 @@
---
version: '3.8' version: '3.8'
services:
prometheus:
image: prom/prometheus:latest
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
ports:
- "9090:9090"
networks:
- snake_net
restart: unless-stopped
grafana:
image: grafana/grafana:latest
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning:ro
- grafana_data:/var/lib/grafana
environment:
GF_SECURITY_ADMIN_PASSWORD: "admin"
GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: /var/lib/grafana/dashboards/home.json
ports:
- "3000:3000"
networks:
- snake_net
restart: unless-stopped
volumes:
grafana_data:
networks: networks:
snake_net: snake_net:
external: true external: true
services:
prometheus:
image: prom/prometheus:latest
container_name: monitoring-prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yaml:/etc/prometheus/prometheus.yml
networks:
- snake_net
grafana:
image: grafana/grafana:latest
container_name: monitoring-grafana
ports:
- "3000:3000"
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning
- ./grafana/dashboards:/var/lib/grafana/dashboards
networks:
- snake_net
nginx-exporter:
image: nginx/nginx-prometheus-exporter:latest
container_name: nginx-exporter
ports:
- "9113:9113"
networks:
- snake_net
blackbox-exporter:
image: prom/blackbox-exporter:latest
container_name: blackbox-exporter
ports:
- "9115:9115"
networks:
- snake_net

View File

@@ -6,3 +6,21 @@ scrape_configs:
- job_name: "prometheus" - job_name: "prometheus"
static_configs: static_configs:
- targets: ["localhost:9090"] - targets: ["localhost:9090"]
- job_name: 'nginx'
static_configs:
- targets: ['nginx-prometheus-exporter:9113']
- job_name: 'snake-game'
metrics_path: /probe
params:
module: [http_2xx] # probe returns 1 if HTTP 200
static_configs:
- targets: ['snake-game:8080'] # snake game container + port
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115