network-automation-scripts/ansible/debian-graylog-example/roles/tasks/task_02_configure_graylog.yaml

31 lines
976 B
YAML
Raw Normal View History

2024-12-28 20:10:53 +01:00
---
# task_02_configure_graylog
# =========================
- name: "Block"
notify: "Restart: graylog-sidecar"
when: ansible_os_family == "Debian"
block:
- name: "Assert vars: graylog-sidecar"
ansible.builtin.assert:
that:
- graylog_server_url is defined
- graylog_server_api_token is defined
- graylog_update_interval is defined
- graylog_tls_skip_verify is defined
- graylog_node_id is defined
- graylog_log_rotate_max_file_size is defined
- graylog_log_rotate_keep_files is defined
- graylog_collector_validation_timeout is defined
- name: "Deploy config: sidecar.yaml.j2"
ansible.builtin.template:
src: sidecar.yaml.j2
dest: /etc/graylog/sidecar/sidecar.yml
backup: true
- name: "Deploy config: node-id.j2"
ansible.builtin.template:
src: node-id.j2
dest: /etc/graylog/sidecar/node-id
backup: false