Skip to content

Commit

Permalink
feat: use unified path for repo key and drop legacy key
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger committed Apr 17, 2023
1 parent 9b73351 commit c586e83
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .later.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ rules:
- molecule/ubuntu/tests
- README.md

warning_filter:
- ANSIBLE0008

...
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,7 @@ journalbeat_logging_to_files: True
# @var journalbeat_logging_selectors:description: Define logging selectors, like beat, publish, service
journalbeat_logging_selectors: []

# @var journalbeat_keyring:description: Path for the repository keyring
journalbeat_keyring: /usr/share/keyrings/elastic-archive-keyring.gpg

...
5 changes: 5 additions & 0 deletions molecule/default/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@
name: python3-gpg
state: present

- name: Install curl dependency
apt:
name: curl
state: present

...
23 changes: 19 additions & 4 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
# Standards: 1.2
---
- name: Download repo key
- name: Remove legacy key
apt_key:
url: https://artifacts.elastic.co/GPG-KEY-elasticsearch
id: 46095ACC8548582C1A2699A9D27D666CD88E42B4
state: present
state: absent
tags:
- journalbeat

- name: Add apt repository
- name: Remove legacy repo
apt_repository:
repo: "deb https://artifacts.elastic.co/packages/{{ journalbeat_major_version }}.x/apt stable main"
filename: elastic
update_cache: False
state: absent
tags:
- journalbeat

- name: Download repo key
shell:
cmd: "curl -sSL 'https://artifacts.elastic.co/GPG-KEY-elasticsearch' | gpg --dearmor --output {{ journalbeat_keyring }}"
creates: "{{ journalbeat_keyring }}"
tags:
- journalbeat

- name: Add apt repository
apt_repository:
repo: "deb [signed-by={{ journalbeat_keyring }}] https://artifacts.elastic.co/packages/{{ journalbeat_major_version }}.x/apt stable main"
filename: elastic
update_cache: True
state: present
tags:
Expand Down

0 comments on commit c586e83

Please sign in to comment.