Compare commits

...

7 Commits

Author SHA1 Message Date
marguskoiduste 9a8e78dc0e
Merge e51455b491 into f5ba58c59e 2025-04-03 16:33:29 +00:00
Rath Pascal f5ba58c59e update ci 2025-02-15 13:32:07 +01:00
Rath Pascal 9e1e7968f3 update ci 2025-02-15 13:17:02 +01:00
Rath Pascal 2be30f1ab0 update ci 2025-02-15 13:03:59 +01:00
Rath Pascal def0cffb70 update ci 2025-02-15 12:57:29 +01:00
Rath Pascal 1ef9ddac31 update ci 2025-02-15 09:25:38 +01:00
marguskoiduste e51455b491
Attempt fixing https config template 2024-02-11 00:57:31 +02:00
7 changed files with 97 additions and 15 deletions

3
.github/FUNDING.yml vendored
View File

@ -1,4 +1 @@
---
ko_fi: ansible0guy
github: ansibleguy

View File

@ -0,0 +1,41 @@
---
name: Integration-Tests
on:
schedule:
- cron: "56 6 * * *"
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 1
env:
CI_JOB: 'ansible-test-molecule-${{ github.event.repository.name }}'
CI_DOMAIN: 'ci.ansibleguy.net'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Install dependencies
run: sudo apt install curl jq
shell: bash
- name: Pulling logs
run: curl --fail-with-body https://${{ env.CI_DOMAIN }}/api/job/${{ env.CI_JOB }}/logs?token=${{ secrets.CI_TOKEN_RW }} | jq > /tmp/test.log
shell: bash
- uses: actions/upload-artifact@v4
with:
name: test-logs
path: /tmp/test.log
retention-days: 14
- name: Checking job-state
run: >
curl --fail-with-body https://${{ env.CI_DOMAIN }}/api/job/${{ env.CI_JOB }}/state?token=${{ secrets.CI_TOKEN_RW }} | jq -r '.state' | grep -q 'failed' && exit 1 || exit 0
shell: bash

View File

@ -0,0 +1,34 @@
---
name: Integration-Tests Execution
on: workflow_dispatch
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 1
env:
CI_JOB: 'ansible-test-molecule-${{ github.event.repository.name }}'
CI_DOMAIN: 'ci.ansibleguy.net'
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
- name: Install dependencies
run: sudo apt install curl
shell: bash
- name: Starting Tests
run: curl --fail-with-body -XPOST https://${{ env.CI_DOMAIN }}/api/job/${{ env.CI_JOB }}?token=${{ secrets.CI_TOKEN_RW }}
shell: bash
- name: You can pull the current logs at this URL
run: >
echo "You can pull the current logs at this URL:"
echo " > https://${{ env.CI_DOMAIN }}/api/job/${{ env.CI_JOB }}/tail?token=${CI_TOKEN_RO}"
env:
CI_TOKEN_RO: "2b7bba30-9a37-4b57-be8a-99e23016ce70"

View File

@ -10,6 +10,10 @@ on:
- '**.yml'
- '.github/workflows/lint.yml'
- 'requirements_lint.txt'
- '.yamllint'
- '.pylintrc'
- '.pylintrc_j2'
- '.ansible-lint.yml'
pull_request:
branches: [main, stable, latest]
paths:
@ -17,9 +21,13 @@ on:
- '**.yml'
- '.github/workflows/lint.yml'
- 'requirements_lint.txt'
- '.yamllint'
- '.pylintrc'
- '.pylintrc_j2'
- '.ansible-lint.yml'
jobs:
build:
lint:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
@ -31,7 +39,7 @@ jobs:
- name: Install python
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.11'
- name: Install dependencies
run: |

View File

@ -6,4 +6,4 @@ rules:
truthy:
allowed-values: ['true', 'false', 'yes', 'no']
line-length:
max: 160
max: 190

View File

@ -4,18 +4,20 @@
Ansible Role to deploy one or multiple Apache2 sites on a linux server.
<a href='https://ko-fi.com/ansible0guy' target='_blank'><img height='35' style='border:0px;height:46px;' src='https://az743702.vo.msecnd.net/cdn/kofi3.png?v=0' border='0' alt='Buy me a coffee' />
[![Molecule Test Status](https://badges.ansibleguy.net/infra_apache.molecule.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/molecule.sh.j2)
[![YamlLint Test Status](https://badges.ansibleguy.net/infra_apache.yamllint.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/yamllint.sh.j2)
[![PyLint Test Status](https://badges.ansibleguy.net/infra_apache.pylint.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/pylint.sh.j2)
[![Ansible-Lint Test Status](https://badges.ansibleguy.net/infra_apache.ansiblelint.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/ansiblelint.sh.j2)
[![Lint](https://github.com/ansibleguy/infra_apache/actions/workflows/lint.yml/badge.svg)](https://github.com/ansibleguy/infra_apache/actions/workflows/lint.yml)
[![Ansible Galaxy](https://badges.ansibleguy.net/galaxy.badge.svg)](https://galaxy.ansible.com/ui/standalone/roles/ansibleguy/infra_apache)
Molecule Logs: [Short](https://badges.ansibleguy.net/log/molecule_infra_apache_test_short.log), [Full](https://badges.ansibleguy.net/log/molecule_infra_apache_test.log)
**Molecule Integration-Tests**:
* Status: [![Molecule Test Status](https://badges.ansibleguy.net/infra_apache.molecule.svg)](https://github.com/ansibleguy/_meta_cicd/blob/latest/templates/usr/local/bin/cicd/molecule.sh.j2) |
[![Functional-Tests](https://github.com/ansibleguy/infra_apache/actions/workflows/integration_test_result.yml/badge.svg)](https://github.com/ansibleguy/infra_apache/actions/workflows/integration_test_result.yml)
* Logs: [API](https://ci.ansibleguy.net/api/job/ansible-test-molecule-infra_apache/logs?token=2b7bba30-9a37-4b57-be8a-99e23016ce70&lines=1000) | [Short](https://badges.ansibleguy.net/log/molecule_infra_apache_test_short.log) | [Full](https://badges.ansibleguy.net/log/molecule_infra_apache_test.log)
Internal CI: [Tester Role](https://github.com/ansibleguy/_meta_cicd) | [Jobs API](https://github.com/O-X-L/github-self-hosted-jobs-systemd)
**Tested:**
* Debian 11
* Debian 12
----

View File

@ -21,7 +21,7 @@
{% if site.security.restrict_methods | bool %}
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^(?!{{ for method in APACHE_CONFIG.security.restricted_methods | join('|') }})
RewriteCond %{REQUEST_METHOD} ^(?!{{ APACHE_CONFIG.security.restricted_methods | join('|') }})
RewriteRule .* - [L,R=405]
</IfModule>
<Directory />
@ -32,7 +32,7 @@
{% elif site.security.deny_dangerous_methods | bool %}
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^({{ for method in APACHE_CONFIG.security.dangerous_methods | join('|') }})
RewriteCond %{REQUEST_METHOD} ^({{ APACHE_CONFIG.security.dangerous_methods | join('|') }})
RewriteRule .* - [L,R=405]
</IfModule>
<Directory />