DataDog / ansible-datadog

Ansible role for Datadog Agent
Apache License 2.0
297 stars 222 forks source link

Unable to find package datadog-agent available for amazon linux 2023 for ansible galaxy installation #565

Closed jeannot-ranaivosoa closed 4 months ago

jeannot-ranaivosoa commented 4 months ago

Hi all,

I am running the datadog role with ansible-galaxy in an amazon linux 2023 EC2. Nothing more than setting the datadog role in a simple playbook and running ansible-galaxy command

 - hosts: servers
  roles:
    - { role: datadog.datadog, become: yes }
  vars:
    datadog_api_key: "<YOUR_DD_API_KEY>"
    datadog_agent_version: "7.32.3.0"

With ansible 2.15.3

$ ansible --version
ansible [core 2.15.3]
  config file = None
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.9.16 (main, Sep  8 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] (/usr/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True

Just setting the datadog_agent_major_version variable as 7 running the playbook get me this error

    amazon-ebs: TASK [datadog-agent : include_tasks] *******************************************
    amazon-ebs: included: /tmp/packer-provisioner-ansible-local/play-apps/roles/datadog-agent/tasks/pkg-redhat/install-latest.yml for 127.0.0.1
    amazon-ebs:
    amazon-ebs: TASK [datadog-agent : Install latest datadog-agent package (dnf)] **************
    amazon-ebs: fatal: [127.0.0.1]: FAILED! => {"changed": false, "failures": ["No package datadog-agent available."], "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}

Using directly the datadog_agent_version variable with a specific version such as 7.32.0-1 get me this error :

    amazon-ebs: TASK [datadog-agent : Install pinned datadog-agent package (dnf)] **************
    amazon-ebs: fatal: [127.0.0.1]: FAILED! => {"changed": false, "failures": ["No package datadog-agent-7.32.0-1 available."], "msg": "Failed to install some of the specified packages", "rc": 1, "results": []}

It seems either i missed something in my amazon linux instance , some dependancy lacking or else, it cannot retrieve any data-agent releases. I strongly doubt that the installation is incompatible with amazon linux 2023 instances so perhaps i missed something.

jeannot-ranaivosoa commented 4 months ago

I was using an old ansible role version ( 4.8 ) Upgrading to 4.22 fixed it for me