ci: add various configs and linter fixes

This commit is contained in:
Simon Cornet 2026-02-16 17:51:23 +01:00
commit b92f2c6175
5 changed files with 18 additions and 6 deletions

12
.markdownlint-cli2.jsonc Normal file
View file

@ -0,0 +1,12 @@
{
// files to lint
"globs": [
"readme.md"
],
// linting rules
"config": {
"MD013": {
"line_length": 120
}
}
}

View file

@ -11,7 +11,8 @@
ansible.builtin.shell:
cmd: |
{% for route in static_routes %}
ip route replace {{ route.destination }} via {{ route.gateway }}{{ ' dev ' + route.interface if route.interface is defined else '' }}
ip route replace {{ route.destination }} via {{ route.gateway }}
{% if route.interface is defined %}dev {{ route.interface }}{% endif %}
{% endfor %}
when: "static_routes | length > 0"
changed_when: false

View file

@ -10,7 +10,7 @@
# due to semaphore bug we need to do this ourselves
- name: "force-update requirements"
ansible.builtin.command:
cmd: "ansible-galaxy install -f -r roles/requirements.yaml"
cmd: "ansible-galaxy install -f -r roles/requirements.yml"
become: false
delegate_to: "localhost"
changed_when: false

View file

@ -43,14 +43,13 @@
block: |
{% for route in static_routes %}
# {{ route.name }}
{% if route.metric is defined %}
{% if route.metric is defined %}
down ip route del {{ route.destination }} via {{ route.gateway }}{{ ' dev ' + route.interface if route.interface is defined else '' }} metric {{ route.metric }}
up ip route add {{ route.destination }} via {{ route.gateway }}{{ ' dev ' + route.interface if route.interface is defined else '' }} metric {{ route.metric }}
{% else %}
{% else %}
down ip route del {{ route.destination }} via {{ route.gateway }}{{ ' dev ' + route.interface if route.interface is defined else '' }}
up ip route add {{ route.destination }} via {{ route.gateway }}{{ ' dev ' + route.interface if route.interface is defined else '' }}
{% endif %}
{% endif %}
{% endfor %}
insertafter: "^iface {{ lan_interface }} inet.*\\n(\\s+.*\\n)*\\s+netmask"
state: "{{ 'present' if static_routes | length > 0 else 'absent' }}"