This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Run Ansible
|
name: 🏃♂️Run Ansible
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -12,7 +12,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Setup SSH for submodules
|
- name: 🔐Setup SSH for submodules
|
||||||
run: |
|
run: |
|
||||||
echo "Key length: ${#SSH_PRIVATE_KEY}"
|
echo "Key length: ${#SSH_PRIVATE_KEY}"
|
||||||
mkdir -p $HOME/.ssh
|
mkdir -p $HOME/.ssh
|
||||||
@@ -28,44 +28,46 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
SSH_PRIVATE_KEY: ${{ secrets.SSHKEY_B64 }}
|
SSH_PRIVATE_KEY: ${{ secrets.SSHKEY_B64 }}
|
||||||
|
|
||||||
- name: Checkout Repository
|
- name: 🔎Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
# Python 3 installieren, was für pip und Ansible notwendig ist
|
# Python 3 installieren, was für pip und Ansible notwendig ist
|
||||||
|
|
||||||
- name: Set up Python
|
- name: ⚙️Setup Python
|
||||||
uses: actions/setup-python@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.x' # Wählt die neueste Python 3 Version
|
python-version: '3.x' # Wählt die neueste Python 3 Version
|
||||||
|
|
||||||
# Abhängigkeiten aktualisieren und Ansible über pip installieren
|
# Abhängigkeiten aktualisieren und Ansible über pip installieren
|
||||||
- name: Install Ansible via pip
|
- name: ⚙️Install Ansible via pip
|
||||||
run: |
|
run: |
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install ansible
|
pip install ansible
|
||||||
|
|
||||||
# vault file anlegen
|
# vault file anlegen
|
||||||
- name: create vault file
|
- name: 🔑create vault file
|
||||||
run: echo "${{ secrets.ANSIBLE_VAULT_KEY }}" > .vault_pass.txt
|
run: echo "${{ secrets.ANSIBLE_VAULT_KEY }}" > .vault_pass.txt
|
||||||
|
|
||||||
- name: Manuelles Submodule Update
|
- name: 📋Manuelles Submodule Update
|
||||||
run: |
|
run: |
|
||||||
git submodule init
|
git submodule init
|
||||||
git submodule update --recursive --init --force
|
git submodule update --recursive --init --force
|
||||||
|
|
||||||
- name: Install Ansible roles
|
- name: ⚙️Install Ansible roles
|
||||||
run: |
|
run: |
|
||||||
ansible-galaxy role install -r requirements.yml --roles-path ./roles
|
ansible-galaxy role install -r requirements.yml --roles-path ./roles
|
||||||
|
|
||||||
- name: Check Ansible roles exists
|
- name: 🔎Check Ansible roles exists
|
||||||
run: |
|
run: |
|
||||||
ansible-galaxy list
|
ansible-galaxy list
|
||||||
|
|
||||||
- name: Check Ansible Playbook Syntax
|
- name: 🔎Check Ansible Playbook Syntax
|
||||||
run: |
|
run: |
|
||||||
ansible-playbook --syntax-check playbooks/update_debian.yml.ansible
|
ansible-playbook --syntax-check playbooks/update_debian.yml.ansible
|
||||||
|
ansible-playbook --syntax-check playbooks/install_postgresql.yml.ansible
|
||||||
|
|
||||||
- name: Run Ansible Playbook
|
- name: 🏃♂️Run Ansible Playbook
|
||||||
run: |
|
run: |
|
||||||
ansible-playbook -i inventory/raspberries.yaml playbooks/update_debian.yml.ansible --vault-password-file .vault_pass.txt
|
ansible-playbook -i inventory/raspberries.yaml playbooks/update_debian.yml.ansible --vault-password-file .vault_pass.txt
|
||||||
|
ansible-playbook -i inventory/raspberries.yaml playbooks/install_postgresql.yml.ansible --vault-password-file .vault_pass.txt
|
||||||
8
playbooks/install_postgresql.yml.ansible
Normal file
8
playbooks/install_postgresql.yml.ansible
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
- hosts:
|
||||||
|
- postgresql
|
||||||
|
gather_facts: true
|
||||||
|
become: true
|
||||||
|
roles:
|
||||||
|
- etcd
|
||||||
|
- postgresql
|
||||||
|
- handlers
|
||||||
@@ -1,3 +1,15 @@
|
|||||||
|
# defaults
|
||||||
|
- name: handlers
|
||||||
|
src: git+ssh://gitea@gitea.mod.home/ansible-roles/handlers.git
|
||||||
|
scm: git
|
||||||
|
version: main
|
||||||
|
|
||||||
|
- name: common
|
||||||
|
src: git+ssh://gitea@gitea.mod.home/ansible-roles/common.git
|
||||||
|
scm: git
|
||||||
|
version: main
|
||||||
|
|
||||||
|
# monitoring
|
||||||
- name: prometheus
|
- name: prometheus
|
||||||
src: git+ssh://gitea@gitea.mod.home/ansible-monitoring/prometheus.git
|
src: git+ssh://gitea@gitea.mod.home/ansible-monitoring/prometheus.git
|
||||||
scm: git
|
scm: git
|
||||||
@@ -12,3 +24,16 @@
|
|||||||
src: git+ssh://gitea@gitea.mod.home/ansible-monitoring/grafana.git
|
src: git+ssh://gitea@gitea.mod.home/ansible-monitoring/grafana.git
|
||||||
scm: git
|
scm: git
|
||||||
version: main
|
version: main
|
||||||
|
|
||||||
|
# database
|
||||||
|
- name: net_apps
|
||||||
|
src: git+ssh://gitea@gitea.mod.home:2222/ansible-roles/net_apps.git
|
||||||
|
scm: git
|
||||||
|
version: main
|
||||||
|
|
||||||
|
- name: postgresql
|
||||||
|
src: git+ssh://gitea@gitea.mod.home:2222/ansible-roles/postgresql.git
|
||||||
|
scm: git
|
||||||
|
version: main
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user