CI: pip install raus, molecule auf Runner vorinstalliert
Test & Deploy Hugo Docker CMS / test-and-deploy (push) Failing after 2m4s
Test & Deploy Hugo Docker CMS / test-and-deploy (push) Failing after 2m4s
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
---
|
||||
- name: Verify
|
||||
hosts: all
|
||||
gather_facts: true
|
||||
vars:
|
||||
deploy_path: "/tmp/.docker/hugo"
|
||||
tasks:
|
||||
- name: Prüfe Verzeichnisstruktur
|
||||
ansible.builtin.stat:
|
||||
path: "{{ deploy_path }}/{{ item }}"
|
||||
loop:
|
||||
- content
|
||||
- crt
|
||||
- site/assets/css/main.css
|
||||
- site/layouts/_default/baseof.html
|
||||
- site/layouts/_default/list.html
|
||||
- site/layouts/_default/rss.xml
|
||||
- site/layouts/_default/single.html
|
||||
- site/layouts/partials/footer.html
|
||||
- site/layouts/partials/header.html
|
||||
- site/layouts/partials/head.html
|
||||
- site/layouts/partials/toc.html
|
||||
- site/entrypoint.sh
|
||||
- site/hugo.toml
|
||||
- Caddyfile
|
||||
- docker-compose.yml
|
||||
register: file_check
|
||||
|
||||
- name: Alle Dateien müssen existieren
|
||||
ansible.builtin.assert:
|
||||
that: file_check.results | map(attribute='stat.exists') | list | min
|
||||
fail_msg: "Fehlende Dateien im Deploy-Verzeichnis!"
|
||||
success_msg: "Alle Dateien im Deploy-Verzeichnis vorhanden."
|
||||
|
||||
- name: Prüfe Entrypoint ausführbar
|
||||
ansible.builtin.stat:
|
||||
path: "{{ deploy_path }}/site/entrypoint.sh"
|
||||
register: entrypoint_stat
|
||||
|
||||
- name: Entrypoint muss ausführbar sein
|
||||
ansible.builtin.assert:
|
||||
that: entrypoint_stat.stat.executable
|
||||
fail_msg: "entrypoint.sh ist nicht ausführbar!"
|
||||
success_msg: "entrypoint.sh ist ausführbar."
|
||||
|
||||
- name: Prüfe Template-Inhalte
|
||||
ansible.builtin.shell: |
|
||||
grep -q "test-node:5443" {{ deploy_path }}/site/hugo.toml
|
||||
grep -q "test-node:5443" {{ deploy_path }}/Caddyfile
|
||||
register: template_check
|
||||
changed_when: false
|
||||
|
||||
- name: Templates müssen Hostname enthalten
|
||||
ansible.builtin.assert:
|
||||
that: template_check.rc == 0
|
||||
fail_msg: "Templates enthalten nicht den Ziel-Hostnamen!"
|
||||
success_msg: "Templates korrekt gerendert."
|
||||
|
||||
- name: Prüfe Zertifikatsdateien
|
||||
ansible.builtin.stat:
|
||||
path: "{{ deploy_path }}/crt/ca.crt"
|
||||
register: ca_check
|
||||
|
||||
- name: CA-Zertifikat muss vorhanden sein
|
||||
ansible.builtin.assert:
|
||||
that: ca_check.stat.exists
|
||||
fail_msg: "CA-Zertifikat fehlt!"
|
||||
success_msg: "CA-Zertifikat vorhanden."
|
||||
Reference in New Issue
Block a user