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}
steps:
- name: ansible-later
image: quay.io/thegeeklab/ansible-later:4
- name: ansible-lint
image: quay.io/thegeeklab/ansible-dev-tools:1
commands:
- ansible-later
- ansible-lint
environment:
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:
# eth0:
# bootproto: none
# onboot: yes
# onboot: "yes"
# hwaddr: "aa:bb:cc:dd:ee"
# ipaddr: 192.168.0.5
# prefix: 26
# gateway: "192.168.0.1"
# userctl: no
# userctl: "no"
# @end
network_routes: {}

View File

@ -5,7 +5,8 @@
listen: __network_host_reboot
- 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
poll: 0
when:
@ -20,7 +21,7 @@
msg: "Reboot triggered by Ansible"
async: 1
poll: 0
ignore_errors: True
ignore_errors: True # noqa ignore-errors
when: network_reboot_enabled | bool
listen: __network_host_reboot

View File

@ -20,5 +20,3 @@ galaxy_info:
galaxy_tags:
- network
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:
var_files: "{{ lookup('first_found', params, errors='ignore') }}"
params:
@ -11,6 +12,8 @@
paths:
- "vars"
when: var_files
- ansible.builtin.include_tasks: nm.yml
- name: Configure NetworkManager
ansible.builtin.include_tasks: nm.yml
when: __network_nmcli | bool
- ansible.builtin.include_tasks: setup.yml
- name: Configure network
ansible.builtin.include_tasks: setup.yml