2020-08-09 20:41:48 +00:00
|
|
|
---
|
|
|
|
- name: Check if element is already deployed
|
|
|
|
stat:
|
|
|
|
path: "{{ element_webapp_dir }}/element-v{{ element_version }}"
|
|
|
|
register: element_app_directory
|
|
|
|
|
|
|
|
- name: Deploy element
|
|
|
|
block:
|
|
|
|
- name: Create gpg temporary home directory
|
|
|
|
file:
|
|
|
|
dest: /tmp/gpg-tmp
|
|
|
|
state: directory
|
|
|
|
mode: 0700
|
|
|
|
|
|
|
|
- name: Download element v{{ element_version }}
|
|
|
|
get_url:
|
2020-12-09 11:51:29 +00:00
|
|
|
url: "https://github.com/vector-im/element-web/releases/download/v{{ element_version }}/element-v{{ element_version }}.tar.gz"
|
2020-08-09 20:41:48 +00:00
|
|
|
dest: "/tmp/element-v{{ element_version }}.tar.gz"
|
2021-10-28 05:16:31 +00:00
|
|
|
register: element_source
|
|
|
|
until: element_source is success
|
|
|
|
retries: 10
|
|
|
|
delay: 5
|
2020-08-09 20:41:48 +00:00
|
|
|
|
|
|
|
- name: Download element v{{ element_version }} signature
|
|
|
|
get_url:
|
2020-12-09 11:51:29 +00:00
|
|
|
url: "https://github.com/vector-im/element-web/releases/download/v{{ element_version }}/element-v{{ element_version }}.tar.gz.asc"
|
2020-08-09 20:41:48 +00:00
|
|
|
dest: "/tmp/element-v{{ element_version }}.tar.gz.asc"
|
2021-10-28 05:16:31 +00:00
|
|
|
register: element_source_sig
|
|
|
|
until: element_source_sig is success
|
|
|
|
retries: 10
|
|
|
|
delay: 5
|
2020-08-09 20:41:48 +00:00
|
|
|
|
2020-12-09 11:51:29 +00:00
|
|
|
- name: Retrieve the Element release key # noqa 301
|
2020-08-09 20:41:48 +00:00
|
|
|
command: >-
|
|
|
|
gpg --no-default-keyring
|
|
|
|
--homedir /tmp/gpg-tmp
|
|
|
|
--keyring /tmp/gpg-tmp/element-key
|
|
|
|
--keyserver hkps://keyserver.ubuntu.com
|
2021-06-23 13:04:21 +00:00
|
|
|
--recv-keys 2BAA9B8552BD9047
|
2020-08-09 20:41:48 +00:00
|
|
|
register: get_element_gpg_key
|
|
|
|
until: get_element_gpg_key.rc == 0
|
|
|
|
retries: 10
|
|
|
|
delay: 2
|
|
|
|
|
|
|
|
- name: "Verify element v{{ element_version }}'s signature" # noqa 301
|
|
|
|
command: >-
|
|
|
|
gpg --no-default-keyring
|
|
|
|
--homedir /tmp/gpg-tmp
|
|
|
|
--keyring /tmp/gpg-tmp/element-key
|
|
|
|
--verify /tmp/element-v{{ element_version }}.tar.gz.asc
|
|
|
|
/tmp/element-v{{ element_version }}.tar.gz
|
|
|
|
register: element_tarball_verification
|
|
|
|
|
|
|
|
- name: Unpack element
|
|
|
|
unarchive:
|
|
|
|
src: "/tmp/element-v{{ element_version }}.tar.gz"
|
|
|
|
dest: "{{ element_webapp_dir }}"
|
|
|
|
remote_src: yes
|
|
|
|
when: element_tarball_verification.rc == 0
|
|
|
|
|
|
|
|
- name: Clean temporary gpg directory
|
|
|
|
file:
|
|
|
|
dest: /tmp/gpg-tmp
|
|
|
|
state: absent
|
|
|
|
when: not element_app_directory.stat.exists
|