Build Windows Templates in RHV
This commit is contained in:
31
roles/systemli.apt_repositories/tasks/key_path.yml
Normal file
31
roles/systemli.apt_repositories/tasks/key_path.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
|
||||
- name: Copy key to remote machine
|
||||
copy:
|
||||
src: "{{ _config.key_path }}"
|
||||
dest: /tmp/{{ _name }}.gpg
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
check_mode: false
|
||||
changed_when: false
|
||||
|
||||
- name: Find out whether {{ _config.key_path }} is armored
|
||||
stat:
|
||||
path: /tmp/{{ _name }}.gpg
|
||||
register: _file
|
||||
|
||||
- name: Add armored key for {{ _name }} by path
|
||||
apt_key:
|
||||
file: /tmp/{{ _name }}.gpg
|
||||
keyring: /usr/share/keyrings/{{ _name }}.gpg
|
||||
when: "'ascii' in _file.stat.charset"
|
||||
|
||||
- name: Add binary key for {{ _name }} by path
|
||||
copy:
|
||||
src: "{{ _config.key_path }}"
|
||||
dest: /usr/share/keyrings/{{ _name }}.gpg
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
when: _file.stat.charset == 'binary'
|
||||
Reference in New Issue
Block a user