-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from gaetan-craft/add_yaml_configuration
Add yaml configuration
- Loading branch information
Showing
6 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
- name: Converge | ||
hosts: all | ||
tasks: | ||
- name: "Include vector" | ||
include_role: | ||
name: "vector" | ||
vars: | ||
vector_template: vector.yaml.j2 | ||
vector_config_file: /etc/vector/vector.yaml | ||
sources: | ||
journald: | ||
type: journald | ||
current_boot_only: true | ||
tcp: | ||
type: socket | ||
mode: tcp | ||
address: 0.0.0.0:6000 | ||
encoding: | ||
codec: json | ||
transforms: | ||
grok: | ||
type: grok_parser | ||
inputs: | ||
- journald | ||
pattern: '(?<capture>\\d+)%{GREEDYDATA}' | ||
sinks: | ||
console: | ||
type: console | ||
encoding: | ||
codec: json | ||
inputs: | ||
- grok |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
dependency: | ||
name: galaxy | ||
driver: | ||
name: docker | ||
lint: | | ||
set -e | ||
yamllint . | ||
ansible-lint | ||
flake8 | ||
platforms: | ||
- name: debian10 | ||
image: jrei/systemd-debian:10 | ||
privileged: true | ||
command: /lib/systemd/systemd | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
- name: rocky8 | ||
image: rockylinux:8 | ||
privileged: true | ||
command: /usr/sbin/init | ||
tmpfs: | ||
- /run | ||
- /tmp | ||
volumes: | ||
- /sys/fs/cgroup:/sys/fs/cgroup:ro | ||
provisioner: | ||
name: ansible | ||
verifier: | ||
name: ansible |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
- name: Verify | ||
hosts: all | ||
gather_facts: true | ||
tasks: | ||
- name: Install netstat | ||
yum: | ||
name: | ||
- net-tools | ||
- procps | ||
state: present | ||
when: ansible_os_family == 'RedHat' | ||
- name: Install netstat | ||
apt: | ||
name: | ||
- net-tools | ||
- procps | ||
state: present | ||
update_cache: yes | ||
when: ansible_os_family == 'Debian' | ||
- name: Execute vector | ||
command: vector --version | ||
changed_when: false | ||
register: vector_version_rc | ||
- name: Check port 6000 is open | ||
community.general.listen_ports_facts: | ||
- name: Assert vector is installed | ||
assert: | ||
that: | ||
- vector_version_rc is success | ||
- 6000 in open_ports | ||
vars: | ||
open_ports: "{{ ansible_facts.tcp_listen | map(attribute='port') }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{{ vector_general_config | default("") }} | ||
sources: | ||
{{ sources | to_nice_yaml | indent(2) }} | ||
transforms: | ||
{{ transforms | to_nice_yaml | indent(2) }} | ||
sinks: | ||
{{ sinks | to_nice_yaml | indent(2) }} |