Compare commits

1 Commits

Author SHA1 Message Date
4ec10f0f65 mit yamllint syntax verbessert 2025-12-16 10:47:32 +01:00
12 changed files with 22 additions and 15878 deletions

0
.ansible/.lock Normal file
View File

View File

@@ -1,70 +0,0 @@
---
name: CI/CD Pipeline
"on":
push:
branches: [main, flip_dev]
jobs:
lint:
runs-on: docker
container:
image: node:20-bullseye
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Python & linters
run: |
apt-get update && apt-get install -y python3 python3-pip bash git
pip3 install --upgrade pip
pip3 install yamllint ansible-lint
- name: Run linters
run: |
yamllint .
deploy:
runs-on: docker
container:
image: node:20-bullseye
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Ansible & dependencies
run: |
apt-get update && apt-get install -y python3 python3-pip openssh-client bash git
pip3 install --upgrade pip
pip3 install ansible
- name: Setup SSH
shell: bash
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SSH_PASSPHRASE: ${{ secrets.SSH_PASSPHRASE }}
run: |
set -euo pipefail
mkdir -p ~/.ssh
chmod 700 ~/.ssh
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
eval "$(ssh-agent -s)"
if [ -n "${SSH_PASSPHRASE:-}" ]; then
echo "$SSH_PASSPHRASE" | ssh-add ~/.ssh/id_ed25519
else
ssh-add ~/.ssh/id_ed25519
fi
ssh -o BatchMode=yes root@213.95.90.157 true
- name: Run Ansible
run: |
ansible-playbook -i ansible/inventory.yaml site.yaml

11
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,11 @@
---
stages:
- lint
yamllint:
stage: lint
image: python:3.12-alpine
before_script:
- pip install --no-cache-dir yamllint
script:
- yamllint .

View File

@@ -1,3 +0,0 @@
{
"ansible.python.interpreterPath": "/opt/homebrew/bin/python3"
}

View File

@@ -1,19 +0,0 @@
---
extends: default
ignore: |
^venv/*
^\.venv/*
^\.gitea/*
^\.git/*
^\.ansible_test/*
^ansible_test/*
^\.ansiblelint/*
rules:
line-length:
max: 400
level: warning
trailing-spaces: disable
indentation:
spaces: 2

View File

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

View File

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

View File

@@ -10,7 +10,7 @@
- name: Create app directory
file:
path: "{{ app_dir }}"
state: directory
state: directory
- name: Copy compose file
copy:

View File

@@ -11,14 +11,12 @@
tag: "1.0"
source: pull
- name: Run snake-game container
docker_container:
name: snake-game
image: dns.s-martika.com/smartika/snake-game:2.0
image: dns.s-martika.com/smartika/snake-game:1.0
state: started
privileged: true
restart_policy: always
ports:
- "8080:8080" # host:container
pull: yes
- "8080:80"

View File

@@ -4,7 +4,7 @@ services:
prometheus:
image: prom/prometheus:latest
volumes:
- ./prometheus.yaml:/etc/prometheus/prometheus.yml:ro
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
ports:
- "9090:9090"
networks:
@@ -13,12 +13,12 @@ services:
grafana:
image: grafana/grafana:latest
user: "472"
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:

File diff suppressed because it is too large Load Diff

View File

@@ -2,9 +2,9 @@
apiVersion: 1
providers:
- name: 'default'
folder: 'Home'
- name: default
orgId: 1
folder: ""
type: file
editable: true
options:
path: /var/lib/grafana/dashboards
path: /etc/grafana/provisioning/dashboards