From d460c17579e888d8524a5b4d38c5eac351fe64fb Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 20 Feb 2021 12:28:20 -0600 Subject: [PATCH] Make onlyoffice install much more dynamic. --- facts/server/network.yml | 8 -------- facts/server/system.yml | 5 +++++ hosts | 16 ++++++++++++---- tasks/server/onlyoffice.yml | 13 +++++-------- 4 files changed, 22 insertions(+), 20 deletions(-) delete mode 100644 facts/server/network.yml create mode 100644 facts/server/system.yml diff --git a/facts/server/network.yml b/facts/server/network.yml deleted file mode 100644 index 1f91180..0000000 --- a/facts/server/network.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -# Network related variables. - -- name: Server | Network | Domains - set_fact: - hyperling: hyperling.com - tmcvideos: tmcvideos.com - demons: getthedemonsout.com \ No newline at end of file diff --git a/facts/server/system.yml b/facts/server/system.yml new file mode 100644 index 0000000..4367742 --- /dev/null +++ b/facts/server/system.yml @@ -0,0 +1,5 @@ +--- +# Network related variables. + +- name: Facts | Server | System | Not Used Yet + set_fact: \ No newline at end of file diff --git a/hosts b/hosts index 88b54dd..2077164 100644 --- a/hosts +++ b/hosts @@ -6,9 +6,6 @@ x570 dell-laptop usb -[server] -office onlyoffice=true - [miner] ;;;;;;; Available options - all require lowercase values ;;;;;; ; amdgpu : Set to anything for installation of AMDGPU-Pro drivers on Ubuntu (20.04 preferred) @@ -33,4 +30,15 @@ office onlyoffice=true ; Valid values: nanopool etherpool f2pool ; usb amdgpu=true -x570 amdgpu=true nanominer=true nanominer_gpu=eth nanominer_gpus=0 nanominer_gpu_pool=nanopool \ No newline at end of file +x570 amdgpu=true nanominer=true nanominer_gpu=eth nanominer_gpus=0 nanominer_gpu_pool=nanopool + +[server] +;;;;;;; Parameters ;;;;;; +; +; domain : Set to the domain which gives the server its FQDN +; Example: hyperling.com +; +; onlyoffice : Set to anything for this server to be configured as an OnlyOffice server. +; Example: true +; +office domain=hyperling.com onlyoffice=true \ No newline at end of file diff --git a/tasks/server/onlyoffice.yml b/tasks/server/onlyoffice.yml index c08f948..9ffdf47 100644 --- a/tasks/server/onlyoffice.yml +++ b/tasks/server/onlyoffice.yml @@ -54,19 +54,16 @@ ## HTTPS ## -# https://helpcenter.onlyoffice.com/installation/docs-community-https-linux.aspx - -- name: Server | OnlyOffice | HTTPS | Hostname - shell: hostname office +# https://helpcenter.only{{ ansible_histname }}.com/installation/docs-community-https-linux.aspx # Certs # - name: Server | OnlyOffice | HTTPS | Check For Cert - shell: ls -l /etc/letsencrypt/live/office.hyperling.com/{fullchain,privkey}.pem + shell: "ls -l /etc/letsencrypt/live/{{ ansible_hostname }}.{{ domain }}/{fullchain,privkey}.pem" register: onlyoffice_cert - name: Server | OnlyOffice | HTTPS | Create Cert - shell: certbot --nginx -d office.hyperling.com -d docs.hyperling.com + shell: "certbot --nginx -d {{ ansible_hostname }}.{{ domain }}" when: onlyoffice_cert.failed # Config # @@ -88,8 +85,8 @@ # create: no # backup: yes # loop: -# - { "regexp": "ssl_certificate ", "line": " ssl_certificate /etc/letsencrypt/live/office.hyperling.com/fullchain.pem" } -# - { "regexp": "ssl_certificate_key ", "line": " ssl_certificate_key /etc/letsencrypt/live/office.hyperling.com/privkey.pem" } +# - { "regexp": "ssl_certificate ", "line": " ssl_certificate /etc/letsencrypt/live/{{ ansible_hostname }}.{{ domain }}/fullchain.pem" } +# - { "regexp": "ssl_certificate_key ", "line": " ssl_certificate_key /etc/letsencrypt/live/{{ ansible_hostname }}.{{ domain }}/privkey.pem" } # Services #