From 3c670b5961f787b43fc2bd7e777ca5e0093304a6 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Sat, 16 Apr 2022 08:07:53 -0500 Subject: [PATCH] Bugfixes + Update Enhancements (#25) * Move certbot to be first. * Comment out HTTPS, will use reverse proxy until it is working properly. * Enhance `update` for pacman + pkg * `update` enhancements to pkg and apt. * Add more FS types to ignore. * Add `freebsd-update` commands, including a clean of previous upgrade (VMs are small and need space!). * Add sudo. * Put the directory back for future updates. * Avoid exit code 2 from freebsd-update install. * Remove word Cleanup. --- facts/general/package.yml | 16 ++++++++++++++-- local.yml | 10 +++++----- tasks/general/software/telegraf.yml | 2 +- tasks/server/software/onlyoffice.yml | 20 +++++++++++--------- 4 files changed, 31 insertions(+), 17 deletions(-) diff --git a/facts/general/package.yml b/facts/general/package.yml index 51d4949..2a293e8 100644 --- a/facts/general/package.yml +++ b/facts/general/package.yml @@ -54,11 +54,17 @@ set_fact: update_accept_var: '$accept' +- name: General | Facts | Package | Update Commands | Helpers | pacman + set_fact: + update_accept_var: '--noconfirm' + when: ansible_pkg_mgr == "pacman" + - name: General | Facts | Package | Update Commands | apt set_fact: update_package_manager: | echo "*** Apt ***" && sudo apt update && + sudo apt autoclean {{ update_accept_var }} && sudo apt autoremove {{ update_accept_var }} && sudo dpkg --configure -a && sudo apt --fix-broken --fix-missing install && @@ -69,15 +75,21 @@ set_fact: update_package_manager: | echo "*** Pacman ***" && - sudo pacman -Syyu && + sudo pacman -Syyu {{ update_accept_var }} && when: ansible_pkg_mgr == "pacman" - name: General | Facts | Package | Update Commands | pkg set_fact: update_package_manager: | + echo "*** FreeBSD-Update ***" && + sudo sh -c "rm -rfv /var/db/freebsd-update; mkdir -v /var/db/freebsd-update" && + sudo freebsd-update fetch install && + echo "*** Pkg ***" && sudo pkg update && - sudo pkg upgrade && + sudo pkg clean {{ update_accept_var }} && + sudo pkg autoremove {{ update_accept_var }} && + sudo pkg upgrade {{ update_accept_var }} && when: ansible_pkg_mgr in ("pkg", "pkgng") - name: General | Facts | Package | Update Commands | parrot-upgrade diff --git a/local.yml b/local.yml index 60df5f9..9f1e48e 100644 --- a/local.yml +++ b/local.yml @@ -155,6 +155,11 @@ - name: Main | Server Setup block: + - include: tasks/server/software/certbot.yml + when: certbot == true + - include: tasks/server/cron/certbot.yml + when: certbot == true + - include: tasks/server/software/onlyoffice.yml when: onlyoffice == true and ansible_pkg_mgr == "apt" @@ -167,11 +172,6 @@ - include: tasks/server/software/grafana.yml when: grafana == true and ansible_pkg_mgr == "apt" - - include: tasks/server/software/certbot.yml - when: certbot == true - - include: tasks/server/cron/certbot.yml - when: certbot == true - - include: tasks/server/software/hugo.yml when: hugo == true diff --git a/tasks/general/software/telegraf.yml b/tasks/general/software/telegraf.yml index 10665c3..10f6eb1 100644 --- a/tasks/general/software/telegraf.yml +++ b/tasks/general/software/telegraf.yml @@ -134,7 +134,7 @@ [[inputs.disk]] # mount_points = ["/"] - ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs", "fdescfs"] + ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs", "fdescfs", "procfs", "nullfs"] [[inputs.diskio]] # devices = ["sda", "sdb", "vd*"] diff --git a/tasks/server/software/onlyoffice.yml b/tasks/server/software/onlyoffice.yml index 2ad17f6..6933e44 100644 --- a/tasks/server/software/onlyoffice.yml +++ b/tasks/server/software/onlyoffice.yml @@ -52,19 +52,20 @@ state: present - +# 2022-04-13 Looks like this went live too early, finish commenting it out. ## HTTPS ## -# https://helpcenter.only{{ ansible_histname }}.com/installation/docs-community-https-linux.aspx +# https://helpcenter.onlyoffice.com/installation/docs-community-https-linux.aspx # Certs # -- name: Server | OnlyOffice | HTTPS | Check For Cert - 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 {{ ansible_hostname }}.{{ domain }}" - when: onlyoffice_cert.failed +#- name: Server | OnlyOffice | HTTPS | Check For Cert +# shell: "ls -l /etc/letsencrypt/live/{{ ansible_hostname }}.{{ domain }}/{fullchain,privkey}.pem" +# register: onlyoffice_cert +# ignore_errors: yes +# +#- name: Server | OnlyOffice | HTTPS | Create Cert +# shell: "certbot --nginx -d {{ ansible_hostname }}.{{ domain }}" +# when: onlyoffice_cert.failed # Config # @@ -94,3 +95,4 @@ service: name: nginx status: reloaded + ignore_errors: yes