diff --git a/tasks/main.yml b/tasks/main.yml index 16d2dc5..a65cbec 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,9 +1,13 @@ --- # tasks file for tco.code +# +- name: "[Code] - import os vars" + ansible.builtin.include_vars: "{{ ansible_os_family|lower }}.yml" + tags: always - name: "[Code] - prereq" ansible.builtin.package: - name: python-lxml + name: "{{ code_deps }}" state: present - name: "[Code] - repository" @@ -12,12 +16,25 @@ name: Collabora Code repo description: Collabora Code repo gpgkey: "https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-centos7/repodata/repomd.xml.key" + when: ansible_os_family | lower == 'redhat' +- name: "[Code] - repository - debian" + block: + - name: setup repo key + ansible.builtin.get_url: + url: https://collaboraoffice.com/downloads/gpg/collaboraonline-release-keyring.gpg + dest: /etc/apt/keyrings/code.gpg + + - name: setup source list + ansible.builtin.template: + src: sources.list + dest: /etc/apt/sources.list.d/collaboraonline.sources + when: ansible_os_family | lower == 'debian' + - name: "[Code] - install packages" ansible.builtin.package: - name: - - coolwsd - - CODE-brand + update_cache: true + name: "{{ code_packages }}" state: present - name: "[Code] - disable ssl" @@ -41,6 +58,7 @@ add_children: "{{ code_clients }}" notify: restart coolwsd + when: code_clients is defined - name: "[Code] - deploy apache conf" block: diff --git a/templates/sources.list b/templates/sources.list new file mode 100644 index 0000000..638f9c2 --- /dev/null +++ b/templates/sources.list @@ -0,0 +1,5 @@ +Types: deb +URIs: https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-deb +Suites: ./ +Signed-By: /etc/apt/keyrings/code.gpg + diff --git a/vars/debian.yml b/vars/debian.yml new file mode 100644 index 0000000..4d5b3fd --- /dev/null +++ b/vars/debian.yml @@ -0,0 +1,6 @@ +code_deps: +- python3-lxml +code_packages: +- coolwsd +- code-brand +apache_config_dir: /etc/apache2/conf-available/ diff --git a/vars/redhat.yml b/vars/redhat.yml new file mode 100644 index 0000000..ac1f0d6 --- /dev/null +++ b/vars/redhat.yml @@ -0,0 +1,7 @@ +code_deps: +- python-lxml + +code_packages: +- coolwsd +- CODE-brand +apache_config_dir: /etc/httpd/conf.d/