fix ansible lint errors

This commit is contained in:
2026-01-02 19:44:35 +03:00
parent af5b00d62d
commit f80a1008c7
14 changed files with 30 additions and 22 deletions

View File

@@ -1,6 +1,9 @@
--- ---
exclude_paths: exclude_paths:
- ".ansible/" - ".ansible/"
- ".crush/"
- ".gitea/" - ".gitea/"
- ".venv/"
- ".vscode/"
- "galaxy.roles/" - "galaxy.roles/"
- "Taskfile.yml" - "Taskfile.yml"

View File

@@ -3,7 +3,7 @@ services:
authelia_app: authelia_app:
container_name: 'authelia_app' container_name: 'authelia_app'
image: 'docker.io/authelia/authelia:4.39.14' image: 'docker.io/authelia/authelia:4.39.14'
user: '{{ user_create_result.uid }}:{{ user_create_result.group }}' user: '{{ owner_create_result.uid }}:{{ owner_create_result.group }}'
restart: 'unless-stopped' restart: 'unless-stopped'
networks: networks:
- "web_proxy_network" - "web_proxy_network"

View File

@@ -7,7 +7,7 @@ echo "Gitea: backup data with gitea dump"
(cd "{{ base_dir }}" && \ (cd "{{ base_dir }}" && \
docker compose exec \ docker compose exec \
-u "{{ user_create_result.uid }}:{{ user_create_result.group }}" \ -u "{{ owner_create_result.uid }}:{{ owner_create_result.group }}" \
-w /backups gitea_app \ -w /backups gitea_app \
gitea dump -c /data/gitea/conf/app.ini \ gitea dump -c /data/gitea/conf/app.ini \
) )

View File

@@ -14,8 +14,8 @@ services:
networks: networks:
- "web_proxy_network" - "web_proxy_network"
environment: environment:
- "USER_UID={{ user_create_result.uid }}" - "USER_UID={{ owner_create_result.uid }}"
- "USER_GID={{ user_create_result.group }}" - "USER_GID={{ owner_create_result.group }}"
- "GITEA__server__SSH_PORT=2222" - "GITEA__server__SSH_PORT=2222"
# Mailer # Mailer

View File

@@ -6,7 +6,7 @@ services:
image: neosmemo/memos:0.25.3 image: neosmemo/memos:0.25.3
container_name: memos_app container_name: memos_app
restart: unless-stopped restart: unless-stopped
user: "{{ user_create_result.uid }}:{{ user_create_result.group }}" user: "{{ owner_create_result.uid }}:{{ owner_create_result.group }}"
networks: networks:
- "web_proxy_network" - "web_proxy_network"
volumes: volumes:

View File

@@ -5,7 +5,7 @@ services:
miniflux_app: miniflux_app:
image: miniflux/miniflux:2.2.10 image: miniflux/miniflux:2.2.10
container_name: miniflux_app container_name: miniflux_app
user: "{{ user_create_result.uid }}:{{ user_create_result.group }}" user: "{{ owner_create_result.uid }}:{{ owner_create_result.group }}"
depends_on: depends_on:
miniflux_postgres: miniflux_postgres:
condition: service_healthy condition: service_healthy
@@ -36,7 +36,7 @@ services:
miniflux_postgres: miniflux_postgres:
image: postgres:16.3-bookworm image: postgres:16.3-bookworm
container_name: miniflux_postgres container_name: miniflux_postgres
user: "{{ user_create_result.uid }}:{{ user_create_result.group }}" user: "{{ owner_create_result.uid }}:{{ owner_create_result.group }}"
restart: 'unless-stopped' restart: 'unless-stopped'
environment: environment:
- POSTGRES_USER={{ miniflux_postgres_user }} - POSTGRES_USER={{ miniflux_postgres_user }}

View File

@@ -5,7 +5,7 @@ services:
outline_app: outline_app:
image: outlinewiki/outline:1.1.0 image: outlinewiki/outline:1.1.0
container_name: outline_app container_name: outline_app
user: "{{ user_create_result.uid }}:{{ user_create_result.group }}" user: "{{ owner_create_result.uid }}:{{ owner_create_result.group }}"
restart: unless-stopped restart: unless-stopped
depends_on: depends_on:
- outline_postgres - outline_postgres
@@ -57,7 +57,7 @@ services:
outline_postgres: outline_postgres:
image: postgres:16.3-bookworm image: postgres:16.3-bookworm
container_name: outline_postgres container_name: outline_postgres
user: "{{ user_create_result.uid }}:{{ user_create_result.group }}" user: "{{ owner_create_result.uid }}:{{ owner_create_result.group }}"
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- "/etc/passwd:/etc/passwd:ro" - "/etc/passwd:/etc/passwd:ro"

View File

@@ -4,7 +4,7 @@ services:
# noinspection ComposeUnknownValues # noinspection ComposeUnknownValues
image: "{{ registry_transcriber_image }}" image: "{{ registry_transcriber_image }}"
container_name: transcriber_app container_name: transcriber_app
user: "{{ user_create_result.uid }}:{{ user_create_result.group }}" user: "{{ owner_create_result.uid }}:{{ owner_create_result.group }}"
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- "{{ config_file }}:/config/config.toml:ro" - "{{ config_file }}:/config/config.toml:ro"
@@ -13,8 +13,8 @@ services:
- "web_proxy_network" - "web_proxy_network"
- "monitoring_network" - "monitoring_network"
environment: environment:
- "USER_UID={{ user_create_result.uid }}" - "USER_UID={{ owner_create_result.uid }}"
- "USER_GID={{ user_create_result.group }}" - "USER_GID={{ owner_create_result.group }}"
command: ./transcriber --config=/config/config.toml command: ./transcriber --config=/config/config.toml
networks: networks:

View File

@@ -6,7 +6,7 @@ services:
image: ghcr.io/muety/wakapi:2.17.0 image: ghcr.io/muety/wakapi:2.17.0
container_name: wakapi_app container_name: wakapi_app
restart: unless-stopped restart: unless-stopped
user: '{{ user_create_result.uid }}:{{ user_create_result.group }}' user: '{{ owner_create_result.uid }}:{{ owner_create_result.group }}'
networks: networks:
- "web_proxy_network" - "web_proxy_network"
volumes: volumes:

View File

@@ -7,7 +7,7 @@ services:
wanderer_search: wanderer_search:
container_name: wanderer_search container_name: wanderer_search
image: getmeili/meilisearch:v1.20.0 image: getmeili/meilisearch:v1.20.0
user: "{{ user_create_result.uid }}:{{ user_create_result.group }}" user: "{{ owner_create_result.uid }}:{{ owner_create_result.group }}"
environment: environment:
<<: *cenv <<: *cenv
MEILI_NO_ANALYTICS: "true" MEILI_NO_ANALYTICS: "true"
@@ -28,7 +28,7 @@ services:
wanderer_db: wanderer_db:
container_name: wanderer_db container_name: wanderer_db
image: "flomp/wanderer-db:{{ wanderer_version }}" image: "flomp/wanderer-db:{{ wanderer_version }}"
user: "{{ user_create_result.uid }}:{{ user_create_result.group }}" user: "{{ owner_create_result.uid }}:{{ owner_create_result.group }}"
depends_on: depends_on:
wanderer_search: wanderer_search:
condition: service_healthy condition: service_healthy
@@ -54,7 +54,7 @@ services:
wanderer_web: wanderer_web:
container_name: wanderer_web container_name: wanderer_web
image: "flomp/wanderer-web:{{ wanderer_version }}" image: "flomp/wanderer-web:{{ wanderer_version }}"
user: "{{ user_create_result.uid }}:{{ user_create_result.group }}" user: "{{ owner_create_result.uid }}:{{ owner_create_result.group }}"
depends_on: depends_on:
wanderer_search: wanderer_search:
condition: service_healthy condition: service_healthy

View File

@@ -22,6 +22,10 @@ pre-commit:
glob: "**/*.{yml,yaml}" glob: "**/*.{yml,yaml}"
run: "uv run yamllint --config-file .yamllint.yml --format colored {staged_files}" run: "uv run yamllint --config-file .yamllint.yml --format colored {staged_files}"
- name: "ansible-lint"
glob: "**/*.{yml,yaml}"
run: "uv run ansible-lint --profile production {staged_files}"
- name: "gitleaks" - name: "gitleaks"
run: "gitleaks git --staged" run: "gitleaks git --staged"

View File

@@ -35,7 +35,7 @@
state: present state: present
line: "{{ primary_user }} ALL=(ALL) NOPASSWD: {{ backup_all_script }}" line: "{{ primary_user }} ALL=(ALL) NOPASSWD: {{ backup_all_script }}"
validate: /usr/sbin/visudo -cf %s # ВАЖНО: проверка синтаксиса перед сохранением validate: /usr/sbin/visudo -cf %s # ВАЖНО: проверка синтаксиса перед сохранением
create: no # Файл уже должен существовать create: false # Файл уже должен существовать
- name: "Copy restic shell script" - name: "Copy restic shell script"
ansible.builtin.template: ansible.builtin.template:

View File

@@ -22,7 +22,7 @@
groups: "{{ owner_extra_groups }}" groups: "{{ owner_extra_groups }}"
uid: "{{ owner_uid }}" uid: "{{ owner_uid }}"
shell: /bin/bash shell: /bin/bash
register: user_create_result register: owner_create_result
- name: 'Set up user ssh keys for user "{{ owner_name }}".' - name: 'Set up user ssh keys for user "{{ owner_name }}".'
ansible.posix.authorized_key: ansible.posix.authorized_key:
@@ -34,7 +34,8 @@
- name: "Prepare env variables." - name: "Prepare env variables."
ansible.builtin.set_fact: ansible.builtin.set_fact:
env_dict: '{{ owner_env | combine({"USER_UID": user_create_result.uid, "USER_GID": user_create_result.group}) }}' # yamllint disable-line rule:line-length
owner_env_dict: '{{ owner_env | combine({"USER_UID": owner_create_result.uid, "USER_GID": owner_create_result.group}) }}'
- name: 'Set up environment variables for user "{{ owner_name }}".' - name: 'Set up environment variables for user "{{ owner_name }}".'
ansible.builtin.template: ansible.builtin.template:
@@ -49,7 +50,7 @@
path: "/home/{{ owner_name }}/.bashrc" path: "/home/{{ owner_name }}/.bashrc"
regexp: "^export {{ item.key }}=" regexp: "^export {{ item.key }}="
state: absent state: absent
with_dict: "{{ env_dict }}" with_dict: "{{ owner_env_dict }}"
- name: 'Include in bashrc environment variables for user "{{ owner_name }}".' - name: 'Include in bashrc environment variables for user "{{ owner_name }}".'
ansible.builtin.lineinfile: ansible.builtin.lineinfile:

View File

@@ -1,3 +1,3 @@
{% for name in env_dict.keys() | sort %} {% for name in owner_env_dict.keys() | sort %}
{{ name }}={{ env_dict[name] }} {{ name }}={{ owner_env_dict[name] }}
{% endfor %} {% endfor %}