2020-07-10 18:42:49 +02:00
|
|
|
- name: Get Fedora GPG Key
|
|
|
|
get_url:
|
2021-03-23 21:30:44 +01:00
|
|
|
url: https://ansible-ci-files.s3.us-east-1.amazonaws.com/test/integration/targets/apt_key/fedora.gpg
|
2020-07-10 18:42:49 +02:00
|
|
|
dest: /tmp/fedora.gpg
|
|
|
|
|
2021-01-28 00:40:58 +01:00
|
|
|
- name: Ensure clean slate
|
|
|
|
apt_key:
|
2021-03-23 21:30:44 +01:00
|
|
|
id: 1161AE6945719A39
|
2021-01-28 00:40:58 +01:00
|
|
|
state: absent
|
|
|
|
|
2020-07-10 18:42:49 +02:00
|
|
|
- name: Run apt_key with both file and keyserver
|
|
|
|
apt_key:
|
|
|
|
file: /tmp/fedora.gpg
|
|
|
|
keyserver: keys.gnupg.net
|
|
|
|
id: 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
|
|
|
|
register: both_file_keyserver
|
|
|
|
ignore_errors: true
|
|
|
|
|
|
|
|
- name: Run apt_key with file only
|
|
|
|
apt_key:
|
|
|
|
file: /tmp/fedora.gpg
|
|
|
|
register: only_file
|
|
|
|
|
|
|
|
- name: Run apt_key with keyserver only
|
|
|
|
apt_key:
|
|
|
|
keyserver: keys.gnupg.net
|
|
|
|
id: 97A1AE57C3A2372CCA3A4ABA6C13026D12C944D0
|
|
|
|
register: only_keyserver
|
|
|
|
|
|
|
|
- name: validate results
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- 'both_file_keyserver is failed'
|
|
|
|
- 'only_file.changed'
|
|
|
|
- 'not only_keyserver.changed'
|
2020-10-08 20:32:59 +02:00
|
|
|
|
|
|
|
- name: remove fedora.gpg
|
|
|
|
apt_key:
|
2021-03-23 21:30:44 +01:00
|
|
|
id: 1161AE6945719A39
|
2020-10-08 20:32:59 +02:00
|
|
|
state: absent
|
|
|
|
register: remove_fedora
|
|
|
|
|
|
|
|
- name: add key from url
|
|
|
|
apt_key:
|
2021-03-23 21:30:44 +01:00
|
|
|
url: https://ansible-ci-files.s3.us-east-1.amazonaws.com/test/integration/targets/apt_key/fedora.gpg
|
2020-10-08 20:32:59 +02:00
|
|
|
register: apt_key_url
|
|
|
|
|
|
|
|
- name: verify key from url
|
|
|
|
assert:
|
|
|
|
that:
|
|
|
|
- remove_fedora is changed
|
|
|
|
- apt_key_url is changed
|