dj-wasabi / ansible-telegraf

Installing and configuring Telegraf via Ansible for RedHat/Debian/Ubuntu/Windows/Suse.
MIT License
134 stars 116 forks source link

Repo installation fails for Almalinux #172

Closed mira-miracoli closed 7 months ago

mira-miracoli commented 1 year ago

Describe the bug When using the role for Almalinux 8.8, the repo and the package are not installed. This is probably because the ansible_distribution is inserted in the baseurl. This fixed it for me:

  - name: "RedHat | Add yum repository"
    yum_repository:
      name: influxdb
      description: InfluxDB Repository - RHEL $releasever
-     baseurl: "{{ telegraf_yum_baseurl[ansible_distribution|lower] | default(telegraf_yum_baseurl['default']) }}"
+     baseurl: "{{ telegraf_yum_baseurl['redhat'] | default(telegraf_yum_baseurl['default']) }}"

Installation method/version Installation method: repo Role version: 0.14.0

Ansible Version

ansible [core 2.13.3]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/centos/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /home/centos/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.13 (main, Nov 16 2022, 15:31:39) [GCC 8.5.0 20210514 (Red Hat 8.5.0-15)]
  jinja version = 3.1.2
  libyaml = True

Targetted hosts Concerns the following OS(es):

Expected behavior Installation of influx repo and telegraf package.

dj-wasabi commented 7 months ago

Can you provide a PR for this?