Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d7be390
added functionality to install vector from repository
beechesII Jan 4, 2022
e4beb5a
changed baseurl for yum repository
beechesII Jan 4, 2022
5f2c462
moved sources,transforms and sinks from defaults to converge.yml
beechesII Jan 11, 2022
39c9719
remove duplicate entry in readme.md
beechesII Feb 4, 2022
44330fb
Fix deb package url
Apr 28, 2022
763f914
Merge pull request #18 from micwiel/master
gaetanfl Jun 8, 2022
5a46e3b
add files required by ansible-galaxy
gaetan-craft Jun 8, 2022
05b7666
Merge pull request #19 from gaetan-craft/fix_ansible_galaxy
gaetanfl Jun 8, 2022
f0019c7
fix tests
gaetan-craft Jun 9, 2022
027941d
Merge pull request #20 from gaetan-craft/fix_tests
gaetanfl Jun 9, 2022
ca06526
Add a template for yaml config generation and ensure vector use the c…
gaetan-craft Jun 10, 2022
c2c412b
Add test for config file usage
gaetan-craft Jun 10, 2022
8e2f6e3
Merge pull request #21 from gaetan-craft/add_yaml_configuration
gaetanfl Jun 10, 2022
97966fd
Prepare release
gaetanfl Jun 10, 2022
6265224
added functionality to install vector from repository
beechesII Jan 4, 2022
3daa0e8
changed baseurl for yum repository
beechesII Jan 4, 2022
7ae331a
rebased pull request branch before merge
xFuture603 Jun 20, 2022
7db51f8
make repository configurable and vector version, in case user want to…
beechesII Aug 31, 2022
c66112e
fix repo creation
beechesII Aug 31, 2022
0c7759e
make transforms realy not required
beechesII Nov 9, 2023
2bb28ee
Update vector repository and lint project (#2)
beechesII Dec 9, 2024
32be517
allow configuring RestartSec in systemd config (#5)
sjedlick Mar 6, 2025
a40d4c0
separation of repo configuration and installation
beechesII Nov 12, 2025
e1efac7
fix ansible-lint action
beechesII Nov 12, 2025
1ab693c
fix var-naming[no-role-prefix]: Variables names from within roles sho…
beechesII Nov 12, 2025
25b0a1f
bump version to 2.0.0
beechesII Nov 12, 2025
3d415f0
add vector_manage_repo to molecule test case
beechesII Nov 13, 2025
55c0518
enhancement - add molecule test for debian 13
beechesII Nov 13, 2025
fdb449d
fix instance creation
beechesII Nov 13, 2025
e4de413
Merge pull request #7 from telekom-mms/separation_of_repo_configurati…
schurzi Nov 14, 2025
efae184
Merge pull request #8 from telekom-mms/6-enhancement-add-molecule-tes…
schurzi Nov 14, 2025
1c636ad
fix: update syntax for ansible_facts in install and repo tasks
Jan 20, 2026
f51ea30
Merge pull request #9 from sjedlick/fix/new_syntax_for_ansible_v13
schurzi Feb 23, 2026
e6ec9ba
fix - meta/main.yml (#10)
beechesII Mar 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .config/ansible-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# .ansible-lint
exclude_paths:
- .cache/ # implicit unless exclude_paths is defined in config
- .ansible/
- molecule/
- .github/

# install collection dependencies
offline: false
32 changes: 32 additions & 0 deletions .github/workflows/ansible-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Ansible Lint # feel free to pick your own name

on: # yamllint disable-line rule:truthy
# Run CI against all pushes (direct commits, also merged PRs), Pull Requests
push:
branches: [master]
paths:
- 'roles/**'
- 'molecule/**'
- 'requirements.txt'
- '.github/workflows/ansible-lint.yml'
- '.config/ansible-lint.yml'
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
paths:
- 'roles/**'
- 'molecule/**'
- 'requirements.txt'
- '.github/workflows/ansible-lint.yml'
- '.config/ansible-lint.yml'

jobs:
ansible-lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- name: Lint Ansible Playbook
uses: ansible/ansible-lint@v25.11.0 # 25
72 changes: 72 additions & 0 deletions .github/workflows/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
name: molecule
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches: [master]
paths:
- 'roles/vector/**'
- 'molecule/ssh_hardening/**'
- '.github/workflows/molecule.yml'
- 'requirements.txt'
pull_request:
branches: [master]
paths:
- 'roles/vector/**'
- 'molecule/default/**'
- '.github/workflows/molecule.yml'
- 'requirements.txt'
schedule:
- cron: '20 10 * * tue'


jobs:
build:
runs-on: ubuntu-latest
env:
PY_COLORS: 1
ANSIBLE_FORCE_COLOR: 1
strategy:
fail-fast: false
matrix:
include:
- molecule_distro: rockylinux8
molecule_docker_command: /usr/lib/systemd/systemd
- molecule_distro: rockylinux9
molecule_docker_command: /usr/lib/systemd/systemd
- molecule_distro: debian13
molecule_docker_command: /usr/lib/systemd/systemd
molecule_distro:
- debian12
- ubuntu2204
- ubuntu2404
molecule_docker_command:
- "/bin/systemd"
steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
path: ansible_collections/telekom_mms/vector
submodules: true

- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5
with:
python-version: 3.12
cache: 'pip'

- name: Install dependencies
run: pip install -r requirements.txt
working-directory: ansible_collections/telekom_mms/vector

- name: Downgrade Ansible for Rocky 8 tests
run: pip install "ansible-core<2.17"
working-directory: ansible_collections/telekom_mms/vector
if: matrix.molecule_distro == 'rockylinux8'

- name: Test with molecule
run: molecule test -s vector
env:
MOLECULE_DISTRO: ${{ matrix.molecule_distro }}
MOLECULE_DOCKER_COMMAND: ${{ matrix.molecule_docker_command }}
working-directory: ansible_collections/telekom_mms/vector
24 changes: 0 additions & 24 deletions .github/workflows/new_version.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/push.yml

This file was deleted.

3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 1.0.0

* initial release
81 changes: 75 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,79 @@
![publish](https://github.com/dzervas/ansible-vector/workflows/publish/badge.svg)
[![molecule](https://github.com/telekom-mms/ansible-vector/actions/workflows/molecule.yml/badge.svg)](https://github.com/telekom-mms/ansible-vector/actions/workflows/molecule.yml) [![ansible-lint](https://github.com/telekom-mms/ansible-vector/actions/workflows/ansible-lint.yml/badge.svg)](https://github.com/telekom-mms/ansible-vector/actions/workflows/ansible-lint.yml)

# Vector ansible role
# ansible-vector

This is an ansible role to set up [vector](https://vector.dev).
It translates the YAML configuration to TOML, so any configuration is possible.
This is a ansible collection to set up [vector](https://vector.dev) on various systems.

For available variables check out [defaults](roles/vector/defaults/main.yml)
## supported & tested OS

Currently only amd64, arch64, arch7 through deb and rpm packages are supported
| OS | Tested
|--------------|--------------------
| Debian 12 | :white_check_mark:
| Debian 13 | :white_check_mark:
| RL8 | :white_check_mark:
| RL9 | :white_check_mark:
| Ubuntu 22.04 | :white_check_mark:
| Ubuntu 24.04 | :white_check_mark:

## Variables

| Variable | Required | Default | Description
|-------------------------------|----------|--------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------
| vector_template | yes | vector.yaml.j2 | path of your vector.yaml template
| vector_config_file | yes | /etc/vector/vector.yaml | system path of your vector.yaml configuration
| vector_groups | no | | add user vector to specified groups
| vector_manage_repo | no | false | configure deb or redhat based repositories
| vector_install_from_repo | no | false | whether to install vector from packages or install from deb or redhat based repositories
| vector_repo_key | no | see `defaults/main.yml` | configurable repo key, in case repo proxy is used
| vector_repo | no | see `defaults/main.yml` | configurable repo, in case repo proxy is used
| vector_restartsec | no | | add RestartSec to systemd config
| vector_package | no | vector | option to define vector version with package name
| vector_version | no | | define vector version while vector is installed by source
| sources | yes | false | ingest observability data from a wide variety of targets [link](https://vector.dev/docs/reference/configuration/sources/)
| transforms | no | false | shape your data as it moves through your Vector topology [link](https://vector.dev/docs/reference/configuration/transforms/)
| sinks | yes | false | deliver your observability data to a variety of destinations [link](https://vector.dev/docs/reference/configuration/sinks/)

## Example for configuration with ansible
```yaml
sources:
journald:
type: journald
current_boot_only: true

transforms:
grok:
type: grok_parser
inputs:
- journald
pattern: '(?<capture>\\d+)%{GREEDYDATA}'

sinks:
vector:
type: vector
inputs: ["journald"]
address: "vector.example.com:9000"
```

## Example playbook
```yaml
- name: Install and configure vector
hosts: all
vars:
sources:
journald:
type: journald
current_boot_only: true
transforms:
grok:
type: grok_parser
inputs:
- journald
pattern: '(?<capture>\\d+)%{GREEDYDATA}'
sinks:
vector:
type: vector
inputs: ["journald"]
address: "vector.example.com:9000"
roles:
- telekom_mms.vector.vector
```
18 changes: 12 additions & 6 deletions galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
---

namespace: dzervas
namespace: telekom_mms
name: vector
version: 2.0.2
readme: README.md
authors:
- Dimitris Zervas <dzervas@dzervas.gr>
- Gaëtan Duchaussois <gaetan.duchaussois@fretlink.com>
- Dylan Humphreys <dylanjhumphreys@gmail.com>
description: vector.dev ansible role
- Daniel Uhlmann <contact@xfuture-digital.de>
- Christopher Grau <c.grau@telekom.de>
description: >-
This is an ansible collection to set up [vector](https://vector.dev) on various systems.
license_file: LICENSE
tags:
- vector
- logging
- monitoring
repository: https://github.com/dzervas/ansible-vector
documentation: https://github.com/dzervas/ansible-vector
issues: https://github.com/dzervas/ansible-vector/issues
dependencies:
community.general: ">=8.6.0"
repository: https://github.com/telekom-mms/ansible-vector
documentation: https://github.com/telekom-mms/ansible-vector
homepage: https://github.com/telekom-mms/ansible-vector
issues: https://github.com/telekom-mms/ansible-vector/issues
14 changes: 14 additions & 0 deletions meta/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
galaxy_info:
namespace: telekom_mms
role_name: vector
author: >-
Dimitris Zervas <dzervas@dzervas.gr>
Gaëtan Duchaussois <gaetan.duchaussois@fretlink.com>
Dylan Humphreys <dylanjhumphreys@gmail.com>
Daniel Uhlmann <contact@xfuture-digital.de>
Christopher Grau <c.grau@telekom.de>
description: >-
This is an ansible collection to set up [vector](https://vector.dev) on various systems.
license: LICENSE
min_ansible_version: "2.17"
2 changes: 2 additions & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
requires_ansible: ">=2.17.0"
21 changes: 21 additions & 0 deletions molecule/vector/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
- name: Converge
hosts: all
vars:
sources:
journald:
type: journald
current_boot_only: true
sinks:
vector:
type: vector
inputs: ["journald"]
address: "vector.example.com:9000"
healthcheck:
enabled: false
vector_install_from_repo: true
vector_manage_repo: true
tasks:
- name: Include role vector
ansible.builtin.include_role:
name: telekom_mms.vector.vector
37 changes: 37 additions & 0 deletions molecule/vector/molecule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
driver:
name: docker

platforms:
- name: instance
image: geerlingguy/docker-${MOLECULE_DISTRO}-ansible:latest
command: ${MOLECULE_DOCKER_COMMAND:-/bin/systemd}
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:rw
privileged: true
cgroupns_mode: host
pre_build_image: true

provisioner:
name: ansible
config_options:
defaults:
deprecation_warnings: false
callback_whitelist: timer,profile_tasks
fact_caching: jsonfile
fact_caching_connection: ./cache
forks: 100
connection:
pipelining: true
verifier:
name: ansible

scenario:
test_sequence:
- dependency
- syntax
- create
- prepare
- converge
- verify
- destroy
Loading