MongoDB: Dimiss apt-key use (#58271) and allow to choose mongodb_version on Jessie
All checks were successful
gitea/ansible-roles/pipeline/head This commit looks good

This commit is contained in:
David Prevot 2022-11-24 11:13:12 +01:00
parent ecd9d1543f
commit 171ece7bba

View file

@ -1,15 +1,31 @@
- name: MongoDB public GPG Key
- name: Look for legacy apt keyring
path: /etc/apt/trusted.gpg
register: _trusted_gpg_keyring
- name: MongoDB embedded GPG key is absent
# url:
data: "{{ lookup('file', 'server-3.4.asc') }}"
id: "B8612B5D"
keyring: /etc/apt/trusted.gpg
state: absent
when: _trusted_gpg_keyring.stat.exists
- name: Add MongoDB GPG key
src: "server-{{mongodb_version}}.asc"
dest: "/etc/apt/trusted.gpg.d/mongodb-server-{{mongodb_version}}.asc"
force: yes
mode: "0644"
owner: root
group: root
- name: enable APT sources list
repo: deb jessie/mongodb-org/3.4 main
repo: "deb jessie/mongodb-org/{{mongodb_version}} main"
state: present
filename: mongodb
filename: "mongodb-org-{{mongodb_version}}"
update_cache: yes
- name: Install packages