refctor: rework ci to ue ansible-lint and fix molecule
This commit is contained in:
parent
227d56d650
commit
a5e1e6f8b0
18
.later.yml
18
.later.yml
@ -1,18 +0,0 @@
|
|||||||
---
|
|
||||||
ansible:
|
|
||||||
custom_modules:
|
|
||||||
- iptables_raw
|
|
||||||
- openssl_pkcs12
|
|
||||||
- proxmox_kvm
|
|
||||||
- ucr
|
|
||||||
- corenetworks_dns
|
|
||||||
- corenetworks_token
|
|
||||||
|
|
||||||
rules:
|
|
||||||
exclude_files:
|
|
||||||
- "LICENSE*"
|
|
||||||
- "**/*.md"
|
|
||||||
- "**/*.ini"
|
|
||||||
|
|
||||||
warning_filter:
|
|
||||||
- ANS126
|
|
@ -9,11 +9,11 @@ steps:
|
|||||||
- name: generate
|
- name: generate
|
||||||
image: quay.io/thegeeklab/ansible-doctor
|
image: quay.io/thegeeklab/ansible-doctor
|
||||||
environment:
|
environment:
|
||||||
ANSIBLE_DOCTOR_EXCLUDE_FILES: molecule/
|
ANSIBLE_DOCTOR_EXCLUDE_FILES: "['molecule/']"
|
||||||
ANSIBLE_DOCTOR_FORCE_OVERWRITE: "true"
|
ANSIBLE_DOCTOR_RENDERER__FORCE_OVERWRITE: "true"
|
||||||
ANSIBLE_DOCTOR_LOG_LEVEL: INFO
|
ANSIBLE_DOCTOR_LOGGING__LEVEL: info
|
||||||
ANSIBLE_DOCTOR_ROLE_NAME: ${CI_REPO_NAME}
|
ANSIBLE_DOCTOR_ROLE__NAME: ${CI_REPO_NAME}
|
||||||
ANSIBLE_DOCTOR_TEMPLATE: readme
|
ANSIBLE_DOCTOR_TEMPLATE__NAME: readme
|
||||||
|
|
||||||
- name: format
|
- name: format
|
||||||
image: quay.io/thegeeklab/alpine-tools
|
image: quay.io/thegeeklab/alpine-tools
|
||||||
|
@ -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"
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ when:
|
|||||||
|
|
||||||
variables:
|
variables:
|
||||||
- &molecule_base
|
- &molecule_base
|
||||||
image: quay.io/thegeeklab/molecule:6
|
image: quay.io/thegeeklab/ansible-dev-tools:1
|
||||||
group: molecule
|
group: molecule
|
||||||
environment:
|
environment:
|
||||||
PY_COLORS: "1"
|
PY_COLORS: "1"
|
||||||
|
20
.yamllint
Normal file
20
.yamllint
Normal 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
|
@ -3,14 +3,14 @@
|
|||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: k3s
|
name: k3s
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: yes
|
daemon_reload: True
|
||||||
enabled: yes
|
enabled: True
|
||||||
listen: __k3s_restart
|
listen: __k3s_restart
|
||||||
|
|
||||||
- name: Restart iscsid service
|
- name: Restart iscsid service
|
||||||
ansible.builtin.service:
|
ansible.builtin.service:
|
||||||
name: iscsid
|
name: iscsid
|
||||||
state: restarted
|
state: restarted
|
||||||
daemon_reload: yes
|
daemon_reload: True
|
||||||
enabled: yes
|
enabled: True
|
||||||
listen: __iscsid_restart
|
listen: __iscsid_restart
|
||||||
|
@ -4,11 +4,11 @@ driver:
|
|||||||
dependency:
|
dependency:
|
||||||
name: galaxy
|
name: galaxy
|
||||||
options:
|
options:
|
||||||
role-file: molecule/requirements.yml
|
role-file: requirements.yml
|
||||||
requirements-file: molecule/requirements.yml
|
requirements-file: requirements.yml
|
||||||
platforms:
|
platforms:
|
||||||
- name: "rocky9-k3s"
|
- name: "rocky9-k3s"
|
||||||
server_type: "CX22"
|
server_type: "cx22"
|
||||||
image: "rocky-9"
|
image: "rocky-9"
|
||||||
provisioner:
|
provisioner:
|
||||||
name: ansible
|
name: ansible
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
---
|
---
|
||||||
collections: []
|
collections:
|
||||||
|
- name: ansible.posix
|
||||||
|
- name: kubernetes.core
|
||||||
|
|
||||||
roles:
|
roles:
|
||||||
- src: https://gitea.rknet.org/ansible/xoxys.kernel
|
- src: https://gitea.rknet.org/ansible/xoxys.kernel
|
@ -6,7 +6,7 @@
|
|||||||
failed_when: False
|
failed_when: False
|
||||||
|
|
||||||
- name: Clean previous runs of k3s-init
|
- name: Clean previous runs of k3s-init
|
||||||
ansible.builtin.command: systemctl reset-failed k3s-init
|
ansible.builtin.command: systemctl reset-failed k3s-init # noqa command-instead-of-module
|
||||||
failed_when: False
|
failed_when: False
|
||||||
changed_when: False
|
changed_when: False
|
||||||
tags:
|
tags:
|
||||||
@ -23,7 +23,8 @@
|
|||||||
creates: "{{ __k3s_service_file }}"
|
creates: "{{ __k3s_service_file }}"
|
||||||
register: __k3s_init
|
register: __k3s_init
|
||||||
|
|
||||||
- when: __k3s_init.changed | bool
|
- name: Wait for k3s-init to finish
|
||||||
|
when: __k3s_init.changed | bool # noqa no-handler
|
||||||
block:
|
block:
|
||||||
- name: Verify that all nodes actually joined
|
- name: Verify that all nodes actually joined
|
||||||
ansible.builtin.command: >-
|
ansible.builtin.command: >-
|
||||||
|
@ -1,9 +1,14 @@
|
|||||||
---
|
---
|
||||||
- ansible.builtin.include_tasks: reset.yml
|
- name: Reset k3s
|
||||||
|
ansible.builtin.include_tasks: reset.yml
|
||||||
when: k3s_reset | bool
|
when: k3s_reset | bool
|
||||||
- ansible.builtin.include_tasks: prepare.yml
|
- name: Prepare k3s
|
||||||
- ansible.builtin.include_tasks: init.yml
|
ansible.builtin.include_tasks: prepare.yml
|
||||||
|
- name: Initialize cluster
|
||||||
|
ansible.builtin.include_tasks: init.yml
|
||||||
when: k3s_server | bool
|
when: k3s_server | bool
|
||||||
- ansible.builtin.include_tasks: setup.yml
|
- name: Setup k3s
|
||||||
- ansible.builtin.include_tasks: iscsi.yml
|
ansible.builtin.include_tasks: setup.yml
|
||||||
|
- name: Setup iscsi
|
||||||
|
ansible.builtin.include_tasks: iscsi.yml
|
||||||
when: k3s_iscsi_enabled | bool
|
when: k3s_iscsi_enabled | bool
|
||||||
|
Loading…
Reference in New Issue
Block a user