feat(vector): switch to native package with journald, docker_logs, and secret masking
ansible-deploy / plan (push) Successful in 2s
ansible-lint / lint (push) Successful in 2s
ansible-deploy / deploy (core-mon, ) (push) Failing after 33s
ansible-deploy / deploy (core-net, ) (push) Failing after 28s
ansible-deploy / deploy (core-secrets, ) (push) Failing after 38s
ansible-deploy / deploy (ger-nod-02, ) (push) Failing after 31s
ansible-deploy / deploy (rus-central, ) (push) Failing after 49s

This commit is contained in:
karpenok committed 2026-11-18 11:45:05 +07:00
1 parent 1252413a1b
commit 8ab5b65073
4 files changed
+72 -68

No files matched your search

+53 -36
View File
@@ -1,43 +1,60 @@
---
- name: Создать каталоги Vector
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: root
group: root
mode: "0755"
loop:
- "{{ vector_dir }}"
- "{{ vector_dir }}/data"
- name: Проверить наличие старого Docker-контейнера Vector
ansible.builtin.stat:
path: "{{ vector_legacy_dir }}/compose.yaml"
register: vector_legacy_compose
- name: Конфиг Vector
- name: Остановить старый Docker-контейнер Vector
ansible.builtin.command: docker compose -f {{ vector_legacy_dir }}/compose.yaml down --remove-orphans
when: vector_legacy_compose.stat.exists
changed_when: true
- name: Удалить каталог старого Docker-контейнера Vector
ansible.builtin.file:
path: "{{ vector_legacy_dir }}"
state: absent
when: vector_legacy_compose.stat.exists
- name: Подключить APT-репозиторий Vector
ansible.builtin.shell: curl -1sLf 'https://setup.vector.dev' | bash
args:
creates: /etc/apt/sources.list.d/vector.list
- name: Установить нативный пакет Vector
ansible.builtin.apt:
name: vector
state: present
update_cache: true
- name: Выдать пользователю vector доступ к journald и docker
ansible.builtin.user:
name: vector
groups:
- systemd-journal
- docker
append: true
register: vector_user_groups
- name: Подготовить каталог данных Vector
ansible.builtin.file:
path: "{{ vector_data_dir }}"
state: directory
owner: vector
group: vector
mode: "0750"
- name: Установить конфигурацию Vector
ansible.builtin.template:
src: vector.yaml.j2
dest: "{{ vector_dir }}/vector.yaml"
dest: "{{ vector_config_path }}"
owner: root
group: root
mode: "0644"
group: vector
mode: "0640"
validate: "vector validate --no-environment %s"
register: vector_config
- name: Compose Vector
ansible.builtin.template:
src: compose.yaml.j2
dest: "{{ vector_dir }}/compose.yaml"
owner: root
group: root
mode: "0644"
register: vector_compose
- name: Запустить Vector
ansible.builtin.command: docker compose -f {{ vector_dir }}/compose.yaml up -d --remove-orphans
register: vector_up
changed_when: >-
'Started' in vector_up.stderr or
'Created' in vector_up.stderr or
'Recreated' in vector_up.stderr or
'Pulled' in vector_up.stderr
- name: Перезапустить Vector после изменения конфигурации
ansible.builtin.command: docker compose -f {{ vector_dir }}/compose.yaml restart vector
when: vector_config is changed and not (vector_compose is changed)
changed_when: true
- name: Запустить и включить systemd-сервис Vector
ansible.builtin.systemd:
name: vector
enabled: true
state: "{{ 'restarted' if (vector_config is changed or vector_user_groups is changed) else 'started' }}"