refctor: rework ci to ue ansible-lint and fix molecule
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
ci/woodpecker/push/notify Pipeline was successful

This commit is contained in:
Robert Kaussow 2024-08-19 16:06:07 +02:00
parent bf12336f1a
commit 23be96a70e
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
7 changed files with 34 additions and 27 deletions

View File

@ -1,15 +0,0 @@
---
ansible:
custom_modules:
- iptables_raw
- openssl_pkcs12
- proxmox_kvm
- ucr
- corenetworks_dns
- corenetworks_token
rules:
exclude_files:
- "LICENSE*"
- "**/*.md"
- "**/*.ini"

View File

@ -6,10 +6,10 @@ when:
- ${CI_REPO_DEFAULT_BRANCH} - ${CI_REPO_DEFAULT_BRANCH}
steps: steps:
- name: ansible-later - name: ansible-lint
image: quay.io/thegeeklab/ansible-later:4 image: quay.io/thegeeklab/ansible-dev-tools:1
commands: commands:
- ansible-later - ansible-lint
environment: environment:
FORCE_COLOR: "1" FORCE_COLOR: "1"

20
.yamllint Normal file
View File

@ -0,0 +1,20 @@
---
extends: default
rules:
truthy:
allowed-values: ["True", "False"]
comments:
min-spaces-from-content: 1
comments-indentation: False
line-length: disable
braces:
min-spaces-inside: 0
max-spaces-inside: 1
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
indentation: enable
octal-values:
forbid-implicit-octal: True
forbid-explicit-octal: True

View File

@ -12,12 +12,12 @@ network_interfaces: {}
# network_interfaces: # network_interfaces:
# eth0: # eth0:
# bootproto: none # bootproto: none
# onboot: yes # onboot: "yes"
# hwaddr: "aa:bb:cc:dd:ee" # hwaddr: "aa:bb:cc:dd:ee"
# ipaddr: 192.168.0.5 # ipaddr: 192.168.0.5
# prefix: 26 # prefix: 26
# gateway: "192.168.0.1" # gateway: "192.168.0.1"
# userctl: no # userctl: "no"
# @end # @end
network_routes: {} network_routes: {}

View File

@ -5,7 +5,8 @@
listen: __network_host_reboot listen: __network_host_reboot
- name: Restart network - name: Restart network
ansible.builtin.shell: "{{ __network_restart_command }}" ansible.builtin.shell: "{{ __network_restart_command }}" # noqa command-instead-of-shell
changed_when: False
async: 1 async: 1
poll: 0 poll: 0
when: when:
@ -20,7 +21,7 @@
msg: "Reboot triggered by Ansible" msg: "Reboot triggered by Ansible"
async: 1 async: 1
poll: 0 poll: 0
ignore_errors: True ignore_errors: True # noqa ignore-errors
when: network_reboot_enabled | bool when: network_reboot_enabled | bool
listen: __network_host_reboot listen: __network_host_reboot

View File

@ -20,5 +20,3 @@ galaxy_info:
galaxy_tags: galaxy_tags:
- network - network
dependencies: [] dependencies: []
collections:
- community.general

View File

@ -1,5 +1,6 @@
--- ---
- ansible.builtin.include_vars: "{{ var_files }}" - name: Include OS specific vars
ansible.builtin.include_vars: "{{ var_files }}"
vars: vars:
var_files: "{{ lookup('first_found', params, errors='ignore') }}" var_files: "{{ lookup('first_found', params, errors='ignore') }}"
params: params:
@ -11,6 +12,8 @@
paths: paths:
- "vars" - "vars"
when: var_files when: var_files
- ansible.builtin.include_tasks: nm.yml - name: Configure NetworkManager
ansible.builtin.include_tasks: nm.yml
when: __network_nmcli | bool when: __network_nmcli | bool
- ansible.builtin.include_tasks: setup.yml - name: Configure network
ansible.builtin.include_tasks: setup.yml