chore(security): disable vector on external VPS nodes and restrict exit node LAN access
ansible-deploy / plan (push) Successful in 2s
ansible-lint / lint (push) Successful in 2s
ansible-deploy / deploy (core-mon, ) (push) Successful in 8s
ansible-deploy / deploy (core-net, ) (push) Successful in 9s
ansible-deploy / deploy (core-secrets, ) (push) Successful in 8s
ansible-deploy / deploy (ger-nod-02, ) (push) Successful in 2m18s
ansible-deploy / deploy (rus-central, ) (push) Successful in 2m0s

This commit is contained in:
karpenok committed 2026-11-18 12:05:37 +07:00
1 parent 425d878ec7
commit ca25b1d042
5 files changed
+78 -42

No files matched your search

+65 -42
View File
@@ -15,51 +15,74 @@
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, если сбор логов выключен
when: not (vector_enabled | bool)
block:
- name: Проверить наличие systemd-сервиса Vector
ansible.builtin.stat:
path: /lib/systemd/system/vector.service
register: vector_unit
- name: Установить нативный пакет Vector
ansible.builtin.apt:
name: vector
state: present
update_cache: true
- name: Остановить и отключить Vector
ansible.builtin.systemd:
name: vector
state: stopped
enabled: false
when: vector_unit.stat.exists
- 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_config_path }}"
state: absent
- name: Подготовить каталог данных Vector
ansible.builtin.file:
path: "{{ vector_data_dir }}"
state: directory
owner: vector
group: vector
mode: "0750"
- name: Установить и запустить нативный Vector
when: vector_enabled | bool
block:
- name: Подключить APT-репозиторий Vector
ansible.builtin.shell: curl -1sLf 'https://setup.vector.dev' | bash
args:
creates: /etc/apt/sources.list.d/vector.list
- name: Удалить дефолтный vector.toml из пакета, если есть
ansible.builtin.file:
path: /etc/vector/vector.toml
state: absent
- name: Установить нативный пакет Vector
ansible.builtin.apt:
name: vector
state: present
update_cache: true
- name: Установить конфигурацию Vector
ansible.builtin.template:
src: vector.yaml.j2
dest: "{{ vector_config_path }}"
owner: root
group: vector
mode: "0640"
validate: "vector validate --no-environment --config-yaml %s"
register: vector_config
- name: Выдать пользователю vector доступ к journald и docker
ansible.builtin.user:
name: vector
groups:
- systemd-journal
- docker
append: true
register: vector_user_groups
- 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' }}"
- name: Подготовить каталог данных Vector
ansible.builtin.file:
path: "{{ vector_data_dir }}"
state: directory
owner: vector
group: vector
mode: "0750"
- name: Удалить дефолтный vector.toml из пакета, если есть
ansible.builtin.file:
path: /etc/vector/vector.toml
state: absent
- name: Установить конфигурацию Vector
ansible.builtin.template:
src: vector.yaml.j2
dest: "{{ vector_config_path }}"
owner: root
group: vector
mode: "0640"
validate: "vector validate --no-environment --config-yaml %s"
register: vector_config
- 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' }}"