Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
egmont1227 committed Apr 9, 2024
2 parents 8c63578 + 51c2bb6 commit 650b930
Show file tree
Hide file tree
Showing 21 changed files with 439 additions and 100 deletions.
33 changes: 21 additions & 12 deletions .github/workflows/telegraf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,40 +22,49 @@ on:
- '.github/workflows/telegraf.yml'
jobs:
molecule:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
molecule_distro:
- container: centos8
image: geerlingguy/docker-centos8-ansible:latest
- container: centos7
image: geerlingguy/docker-centos7-ansible:latest
- container: rocky8
image: geerlingguy/docker-rockylinux8-ansible
- container: rocky9
image: geerlingguy/docker-rockylinux9-ansible
- container: ubuntu2204
image: geerlingguy/docker-ubuntu2204-ansible:latest
- container: ubuntu2004
image: geerlingguy/docker-ubuntu2004-ansible:latest
- container: ubuntu1804
image: geerlingguy/docker-ubuntu1804-ansible:latest
- container: ubuntu1604
image: geerlingguy/docker-ubuntu1604-ansible:latest
- container: debian9
image: geerlingguy/docker-debian9-ansible:latest
- container: debian8
image: geerlingguy/docker-debian8-ansible:latest
- container: debian10
image: geerlingguy/docker-debian10-ansible:latest
- container: debian11
image: geerlingguy/docker-debian11-ansible:latest
steps:
- name: Check out code
uses: actions/checkout@v1

- name: Set up Python 3.7
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.7
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
curl -so requirements.txt 'https://raw.githubusercontent.com/dj-wasabi/dj-wasabi-release/main/requirements.txt'
pip install -r requirements.txt
- name: Run role tests on empty systems in check-mode
run: >-
MY_MOLECULE_CONTAINER=${{ matrix.molecule_distro.container }}
MY_MOLECULE_IMAGE=${{ matrix.molecule_distro.image }}
MY_MOLECULE_GROUP=${{ matrix.molecule_distro.group }}
MY_MOLECULE_DOCKER_COMMAND=${{ matrix.molecule_distro.command }}
molecule test -s empty-checkmode
- name: Run role tests
run: >-
MY_MOLECULE_CONTAINER=${{ matrix.molecule_distro.container }}
Expand Down
74 changes: 73 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,79 @@

## [0.12.0](https://github.com/noris-network/ansible-telegraf/tree/0.12.0) (2019-03-12)

[Full Changelog](https://github.com/noris-network/ansible-telegraf/compare/0.11.0...0.12.0)
[Full Changelog](https://github.com/dj-wasabi/ansible-telegraf/compare/0.14.1...HEAD)

**Implemented enhancements:**

- Repo installation fails for Almalinux [\#172](https://github.com/dj-wasabi/ansible-telegraf/issues/172)
- Support for sub\_inputs in extra plugins [\#184](https://github.com/dj-wasabi/ansible-telegraf/pull/184) ([lisuml](https://github.com/lisuml))

**Fixed bugs:**

- Add default repository handling for SUSE releases [\#154](https://github.com/dj-wasabi/ansible-telegraf/issues/154)
- Fix Python package dependencies on SUSE releases [\#153](https://github.com/dj-wasabi/ansible-telegraf/issues/153)

**Closed issues:**

- amazon.aws.ec2\_tag\_info [\#177](https://github.com/dj-wasabi/ansible-telegraf/issues/177)
- Failing on Debian Bookwork, telegraf recomends stable main rather than specific release [\#175](https://github.com/dj-wasabi/ansible-telegraf/issues/175)
- Unable to run against linux machines \(redhat\) [\#159](https://github.com/dj-wasabi/ansible-telegraf/issues/159)

**Merged pull requests:**

- Fixes Role for Almalinux 8.8, Closes \#172 [\#183](https://github.com/dj-wasabi/ansible-telegraf/pull/183) ([mira-miracoli](https://github.com/mira-miracoli))

## [0.14.1](https://github.com/dj-wasabi/ansible-telegraf/tree/0.14.1) (2024-02-17)

[Full Changelog](https://github.com/dj-wasabi/ansible-telegraf/compare/0.14.0...0.14.1)

**Implemented enhancements:**

- Fix check-mode failures [\#168](https://github.com/dj-wasabi/ansible-telegraf/pull/168) ([pieterlexis-tomtom](https://github.com/pieterlexis-tomtom))

**Fixed bugs:**

- Fix molecule tests so that PR's can properly validated [\#180](https://github.com/dj-wasabi/ansible-telegraf/pull/180) ([dj-wasabi](https://github.com/dj-wasabi))

**Closed issues:**

- Failure due to apt-key when run against newer Debian/Ubuntu releases [\#169](https://github.com/dj-wasabi/ansible-telegraf/issues/169)

**Merged pull requests:**

- Bump ansible-core from 2.15.2 to 2.15.9 [\#182](https://github.com/dj-wasabi/ansible-telegraf/pull/182) ([dependabot[bot]](https://github.com/apps/dependabot))
- Bump ansible from 8.2.0 to 8.5.0 [\#181](https://github.com/dj-wasabi/ansible-telegraf/pull/181) ([dependabot[bot]](https://github.com/apps/dependabot))
- Change Debian repo location [\#179](https://github.com/dj-wasabi/ansible-telegraf/pull/179) ([danclough](https://github.com/danclough))
- replace depracted aws module [\#178](https://github.com/dj-wasabi/ansible-telegraf/pull/178) ([ThorstenHeck](https://github.com/ThorstenHeck))
- added yaml 1.2.2 compatibility [\#176](https://github.com/dj-wasabi/ansible-telegraf/pull/176) ([DEvil0000](https://github.com/DEvil0000))
- Migrate from io to diskio to fix deprecation warning [\#173](https://github.com/dj-wasabi/ansible-telegraf/pull/173) ([mprasil](https://github.com/mprasil))

## [0.14.0](https://github.com/dj-wasabi/ansible-telegraf/tree/0.14.0) (2023-01-30)

[Full Changelog](https://github.com/dj-wasabi/ansible-telegraf/compare/0.13.3...0.14.0)

**Implemented enhancements:**

- Added/removed OS'es for Molecule CI testing [\#167](https://github.com/dj-wasabi/ansible-telegraf/pull/167) ([dj-wasabi](https://github.com/dj-wasabi))
- Ensure check-mode works [\#163](https://github.com/dj-wasabi/ansible-telegraf/pull/163) ([pieterlexis-tomtom](https://github.com/pieterlexis-tomtom))
- Downgrade support [\#160](https://github.com/dj-wasabi/ansible-telegraf/pull/160) ([maxnasonov](https://github.com/maxnasonov))

**Fixed bugs:**

- Don't install init script on SUSE/openSUSE systems running systemd [\#152](https://github.com/dj-wasabi/ansible-telegraf/issues/152)
- Replace apt\_key with get\_url [\#170](https://github.com/dj-wasabi/ansible-telegraf/pull/170) ([danclough](https://github.com/danclough))
- Fix the molecule run as part of CI process [\#166](https://github.com/dj-wasabi/ansible-telegraf/pull/166) ([dj-wasabi](https://github.com/dj-wasabi))
- update influxdata GPG key after rotation [\#165](https://github.com/dj-wasabi/ansible-telegraf/pull/165) ([Tetha](https://github.com/Tetha))
- Fixed issues with Windows paths containing spaces [\#162](https://github.com/dj-wasabi/ansible-telegraf/pull/162) ([KlettIT](https://github.com/KlettIT))

**Closed issues:**

- Influxdata key rotation causing failure [\#164](https://github.com/dj-wasabi/ansible-telegraf/issues/164)
- Influxdb2 output [\#158](https://github.com/dj-wasabi/ansible-telegraf/issues/158)

## [0.13.3](https://github.com/dj-wasabi/ansible-telegraf/tree/0.13.3) (2022-03-21)

[Full Changelog](https://github.com/dj-wasabi/ansible-telegraf/compare/0.13.2...0.13.3)

## [0.11.0](https://github.com/noris-network/ansible-telegraf/tree/0.11.0) (2018-12-11)

Expand Down
15 changes: 15 additions & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
@@ -1,44 +1,59 @@
A. Binzxxxxxx
Alejandro
Angristan
Anthony ARNAUD
Carl Bäckström
DEvil0000
DJΞRFY
Dan Clough
Daniel Werdermann
Diego Nava
Emerson Knapp
Farshad Nematdoust
Greg
Harald Kraemer
Heckel, Robert J
Ilkka Tengvall
Ismael
Jack Ivy
Jeff Mahoney
Jeroen Geusebroek
Klett IT
Kyle
Laurent Hoss
Lex Rivera
Marcin Wito
Markus Langer
Matt
Max Nasonov
Miro Prasil
Miroslav Prasil
NotDead
Olivier Boukili
Pascal
Pavel Savchenko
PeterSzegedi
Pieter Lexis (TomTom)
Puneeth Nanjundaswamy
Rick Box
Rohit Gohri
Romain BUREAU
Ryan Conway
Simo Tuomisto
Slawomir Skowron
Steve Durrheimer
Steven Wirges
TheCodeAssassin
Thomas Szymanski
ThorstenHeck
Troy Jendra
Werner Dijkerman
Werner Dijkerman [GH bot]
aroglian
dependabot[bot]
gaelL
kingphil
maxwondercorn
or
treanorjp
zend0
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ Telegraf plugin options:
* `interval`: How often to gather this metric. Normal plugins use a single global interval, but if one particular plugin should be run less or more often, you can configure that here.
* `filter.name`: Like when there is an extra filter that needs to be configured, like `grok` for a `logparser` plugin.
* `filter.config`: The extra configuration for the - in the `filter.name` example - `grok` filter. (See example below)
* `sub_inputs`: If the input requires other sub inputs, you can add them here (see example below).

An example might look like this:

Expand Down Expand Up @@ -325,6 +326,30 @@ When you want to make use of the `grok` filter for the logparser:
config:
- patterns = ["invoked oom-killer"]

When you want to include a sub inputs with their own configuration:
```yaml
sqs:
plugin: cloudwatch
config:
- region = "eu-west-1"
- access_key = "foo"
- secret_key = "bar"
- period = "1m"
- delay = "2m"
- interval = "1m"
- namespace = "AWS/SQS"
- statistic_include = ["average"]
sub_inputs:
metrics:
- names = [
"ApproximateAgeOfOldestMessage",
"ApproximateNumberOfMessagesVisible",
]
metrics.dimensions:
- name = "QueueName"
- value = "*"
```
## Dependencies
No dependencies
Expand Down
9 changes: 4 additions & 5 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ telegraf_plugins_default:
config:
- percpu = true
- plugin: disk
- plugin: io
- plugin: diskio
- plugin: mem
- plugin: net
- plugin: system
Expand All @@ -77,7 +77,7 @@ telegraf_yum_baseurl:
default: "https://repos.influxdata.com/{{ ansible_distribution|lower }}/{{ telegraf_redhat_releasever }}/$basearch/stable"
redhat: "https://repos.influxdata.com/rhel/{{ telegraf_redhat_releasever }}/$basearch/stable"
rocky: "https://repos.influxdata.com/rhel/{{ telegraf_redhat_releasever }}/$basearch/stable"
telegraf_yum_gpgkey: "https://repos.influxdata.com/influxdb.key"
telegraf_yum_gpgkey: "https://repos.influxdata.com/influxdata-archive_compat.key"

telegraf_zypper_repos:
"opensuse tumbleweed": "http://download.opensuse.org/repositories/devel:/languages:/go/openSUSE_Factory/"
Expand All @@ -90,8 +90,7 @@ telegraf_win_logfile: 'C:\\Telegraf\\telegraf.log'
telegraf_win_include: 'C:\Telegraf\telegraf_agent.d'
telegraf_win_service_args:
- -service install
- -config {{ telegraf_win_install_dir }}\telegraf.conf
- --config-directory {{ telegraf_win_include }}

- '-config "{{ telegraf_win_install_dir }}\telegraf.conf"'
- '--config-directory "{{ telegraf_win_include }}"'
telegraf_mac_user: user
telegraf_mac_group: admin
8 changes: 6 additions & 2 deletions handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,25 @@
service:
name: telegraf
state: restarted
enabled: yes
enabled: true
when: not telegraf_agent_docker
become: yes
become: true
ignore_errors: "{{ ansible_check_mode }}"

- name: "Restart Telegraf container"
docker_container:
name: "{{ telegraf_agent_docker_name }}"
restart: True
when: telegraf_agent_docker
ignore_errors: "{{ ansible_check_mode }}"

- name: "Restart Windows Telegraf"
win_service:
name: Telegraf
start_mode: auto
state: restarted
ignore_errors: "{{ ansible_check_mode }}"

- name: "Restart MacOS Telegraf"
command: brew services restart telegraf
ignore_errors: "{{ ansible_check_mode }}"
6 changes: 3 additions & 3 deletions molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dependency:
driver:
name: docker

role_name_check: 1
platforms:
- name: influxdb
image: influxdb:1.7-alpine
Expand All @@ -19,10 +20,11 @@ platforms:
command: ${MY_MOLECULE_DOCKER_COMMAND:-""}
privileged: True
pre_build_image: True
cgroupns_mode: host
networks:
- name: telegraf
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
- /sys/fs/cgroup:/sys/fs/cgroup:rw
groups:
- telegraf

Expand Down Expand Up @@ -64,5 +66,3 @@ scenario:
name: default
verifier:
name: testinfra
lint:
name: flake8
14 changes: 13 additions & 1 deletion molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,21 @@
- ansible_os_family == 'RedHat'

- name: "Apt get update"
shell: apt-get update && apt-get install -y python-apt
shell: apt-get update
when:
- ansible_os_family == 'Debian'

- name: "Installing packages on Debian"
apt:
name:
- wget
- "{{ 'gnupg-agent' if ansible_distribution_major_version in ['8', '18', '16'] else 'gpg-agent' }}"
update_cache: True
state: present
when:
- ansible_os_family == 'Debian'
- ansible_distribution_major_version not in [9, 10]

- name: "Installing packages on Debian"
apt:
name:
Expand All @@ -24,6 +35,7 @@
state: present
when:
- ansible_os_family == 'Debian'
- ansible_distribution_major_version in [9, 10]

- name: "Installing packages on Suse"
zypper:
Expand Down
4 changes: 4 additions & 0 deletions molecule/empty-checkmode/converge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- hosts: telegraf
roles:
- role: ansible-telegraf
Loading

0 comments on commit 650b930

Please sign in to comment.