Skip to content

Repos role doesn't have version-specific logic for different Debian versions #403

@cbeaujoin-stellar

Description

@cbeaujoin-stellar

- name: Ensure Elastic Stack key is removed (Debian legacy format)

Since Debian 13, apt-key is not available anymore, it leads to the following error:

TASK [netways.elasticstack.repos : Ensure Elastic Stack key is removed (Debian legacy format)] **************************************************************************************************************************************************************************************************************************************************************************************************************************************
fatal: [x.x.x.x]: FAILED! => {"changed": false, "msg": "Failed to find required executable \"apt-key\" in paths: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"}

According to https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_key_module.html

The apt-key command used by this module has been deprecated. See the [Debian wiki](https://wiki.debian.org/DebianRepository/UseThirdParty) for details. This module is kept for backwards compatibility for systems that still use apt-key as the main way to manage apt repository keys.

This should fix the issue:

- name: Ensure Elastic Stack key is removed (Debian legacy format)
  ansible.builtin.apt_key:
    url: "{{ elasticstack_repo_key }}"
    state: absent
  when: ansible_distribution_major_version <= "12"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions