Ansible-Roles/playbooks/setup_environment.yml
2026-05-08 22:12:36 +03:00

26 lines
1,004 B
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
# Установить conntrack-tools на все управляемые хосты.
# Требуется для сбора данных о соединениях командой conntrack -L (TCP и UDP).
# Пакет называется по-разному: conntrack-tools (CentOS), conntrack (Debian).
#
# Запуск: ansible-playbook -i inventory/prod playbooks/setup_conntrack.yml
- name: Установить environment
hosts: all
gather_facts: true
ignore_unreachable: true
tasks:
- name: Установить conntrack-tools (CentOS) # noqa: command-instead-of-module
ansible.builtin.command:
cmd: yum install -y conntrack-tools
creates: /usr/sbin/conntrack
become: true
when: ansible_os_family | lower == "redhat"
- name: Установить conntrack (Debian)
ansible.builtin.apt:
name: conntrack
state: present
update_cache: false
become: true
when: ansible_os_family | lower == "debian"