diff --git a/README.md b/README.md index 13c04df..bf76d51 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,12 @@ Install and configure Telegraf * Ansible >= 2.9 * Debian - * Buster * Bullseye + * Bookworm ## Role variables +* `telegraf_distribution_release` - set the distribution repository name (default: `ansible_distribution_release`) * `telegraf_config` - hash with the general configuration (see [telegraf documentation](https://docs.influxdata.com/telegraf/latest/administration/configuration/)) ``` diff --git a/defaults/main.yml b/defaults/main.yml index d677741..e721a0f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,4 +1,5 @@ --- +telegraf_distribution_release: "{{ ansible_distribution_release }}" telegraf_default_config: agent: interval: 10s diff --git a/meta/main.yml b/meta/main.yml index 5ab66e9..675bad2 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -11,8 +11,8 @@ galaxy_info: platforms: - name: Debian versions: - - buster - bullseye + - bookworm galaxy_tags: - metrics diff --git a/molecule/default/molecule.yml b/molecule/default/molecule.yml index 0507c53..844210b 100644 --- a/molecule/default/molecule.yml +++ b/molecule/default/molecule.yml @@ -2,11 +2,12 @@ driver: name: docker platforms: - - name: debian10 - image: nishiki/debian10:molecule + - name: debian12 + image: nishiki/debian12:molecule privileged: true volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw + cgroupns_mode: host command: /bin/systemd capabilities: - SYS_ADMIN @@ -14,10 +15,16 @@ platforms: image: nishiki/debian11:molecule privileged: true volumes: - - /sys/fs/cgroup:/sys/fs/cgroup:ro + - /sys/fs/cgroup:/sys/fs/cgroup:rw + cgroupns_mode: host command: /bin/systemd capabilities: - SYS_ADMIN +provisioner: + inventory: + host_vars: + debian12: + telegraf_distribution_release: bullseye lint: | set -e yamllint . diff --git a/tasks/main.yml b/tasks/main.yml index 993a0e1..95fbd76 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -14,7 +14,7 @@ - name: add influx repository ansible.builtin.apt_repository: filename: influx - repo: 'deb https://repos.influxdata.com/debian {{ ansible_distribution_release }} stable' + repo: "deb https://repos.influxdata.com/debian {{ telegraf_distribution_release }} stable" tags: telegraf - name: install influxdb package