From 3b5e3e17bf51e707a8d3f0ee500369466e05371f Mon Sep 17 00:00:00 2001 From: "Philip (a-0)" <@ph:a-0.me> Date: Mon, 23 Jan 2023 18:53:52 +0100 Subject: [PATCH] Initial commit --- defaults/main.yml | 2 ++ meta/main.yml | 2 ++ tasks/main.yml | 43 ++++++++++++++++++++++++++++++++++++++++ templates/apt-sources.j2 | 4 ++++ vars/debian.yml | 2 ++ 5 files changed, 53 insertions(+) create mode 100644 defaults/main.yml create mode 100644 meta/main.yml create mode 100644 tasks/main.yml create mode 100644 templates/apt-sources.j2 create mode 100644 vars/debian.yml diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..cd731a1 --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +--- +collabora_docserver_os_supported: False diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..2002130 --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,2 @@ +--- +galaxy_info: \ No newline at end of file diff --git a/tasks/main.yml b/tasks/main.yml new file mode 100644 index 0000000..fc1bbce --- /dev/null +++ b/tasks/main.yml @@ -0,0 +1,43 @@ +--- +- name: Set OS dependent variables + ansible.builtin.include_vars: "{{ lookup('first_found', params) }}" + vars: + params: + files: + - "{{ ansible_distribution | lower }}_{{ ansible_distribution_version | lower }}.yml" + - "{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version | lower }}.yml" + - "{{ ansible_distribution | lower }}.yml" + - "{{ ansible_os_family | lower }}.yml" + - "{{ ansible_system | lower }}.yml" + paths: + - '{{ role_path }}/vars' + ignore_errors: True + +- name: OS is supported + ansible.builtin.assert: + that: __os_supported + quiet: True + vars: + __os_supported: "{{ lookup('vars', '{}_os_supported'.format(role_name)) | bool }}" + +- name: Download apt repo key + get_url: + url: https://collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg + dest: /usr/share/keyrings/collaboraonline-release-keyring.gpg + owner: root + group: root + +- name: Set apt source + template: + src: apt-sources.j2 + dest: /etc/apt/sources.list.d/collaboraonline.sources + owner: root + group: root + +- name: Install docserver + apt: + pkg: + - coolwsd + - code-brand + update_cache: yes + diff --git a/templates/apt-sources.j2 b/templates/apt-sources.j2 new file mode 100644 index 0000000..250d79c --- /dev/null +++ b/templates/apt-sources.j2 @@ -0,0 +1,4 @@ +Types: deb +URIs: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian11 +Suites: ./ +Signed-By: /usr/share/keyrings/collaboraonline-release-keyring.gpg \ No newline at end of file diff --git a/vars/debian.yml b/vars/debian.yml new file mode 100644 index 0000000..3b5fb01 --- /dev/null +++ b/vars/debian.yml @@ -0,0 +1,2 @@ +--- +collabora_docserver_os_supported: True