фикс ошибок линта и молекулы

This commit is contained in:
Sergey Antropoff
2026-04-27 08:40:08 +03:00
parent 91299fcc1b
commit d9bc3c0bad
122 changed files with 3997 additions and 179 deletions

View File

@@ -0,0 +1,21 @@
---
- name: Converge — argocd template tests
hosts: all
become: false
gather_facts: false
vars:
argocd_namespace: argocd
argocd_ingress_enabled: true
argocd_ingress_host: "argocd.home.local"
argocd_ingress_class: "nginx"
argocd_ingress_tls: false
argocd_ingress_cert_issuer: "letsencrypt-prod"
argocd_insecure: true
tasks:
- name: Render argocd ingress.yaml.j2
ansible.builtin.template:
src: "{{ playbook_dir }}/../../templates/ingress.yaml.j2"
dest: /tmp/argocd-ingress.yaml
mode: "0644"

View File

@@ -0,0 +1,28 @@
---
driver:
name: docker
platforms:
- name: master01
image: geerlingguy/docker-ubuntu2204-ansible:latest
pre_build_image: true
groups:
- k3s_master
provisioner:
name: ansible
playbooks:
converge: converge.yml
verify: verify.yml
config_options:
defaults:
interpreter_python: auto_silent
verifier:
name: ansible
lint: |
set -e
yamllint .
ansible-lint

View File

@@ -0,0 +1,45 @@
---
- name: Verify — argocd templates
hosts: all
become: false
gather_facts: false
tasks:
- name: Read rendered ingress
ansible.builtin.slurp:
src: /tmp/argocd-ingress.yaml
register: ingress_raw
- name: Set content fact
ansible.builtin.set_fact:
content: "{{ ingress_raw.content | b64decode }}"
- name: Assert kind is Ingress
ansible.builtin.assert:
that: "'kind: Ingress' in content"
fail_msg: "kind: Ingress не найден"
- name: Assert namespace
ansible.builtin.assert:
that: "'namespace: argocd' in content"
fail_msg: "namespace: argocd не найден"
- name: Assert ingress host
ansible.builtin.assert:
that: "'argocd.home.local' in content"
fail_msg: "argocd.home.local не найден в Ingress"
- name: Assert backend-protocol annotation
ansible.builtin.assert:
that: "'backend-protocol' in content"
fail_msg: "nginx backend-protocol аннотация не найдена"
- name: Assert ingressClass
ansible.builtin.assert:
that: "'nginx' in content"
fail_msg: "ingressClassName nginx не найден"
- name: Assert TLS section is absent (tls disabled)
ansible.builtin.assert:
that: "'secretName: argocd-tls' not in content"
fail_msg: "TLS секция не должна присутствовать при argocd_ingress_tls: false"