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.
This commit is contained in:
Hyperling 2022-04-16 08:07:53 -05:00 committed by GitHub
parent cdfb257b21
commit 3c670b5961
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 31 additions and 17 deletions

View File

@ -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

View File

@ -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

View File

@ -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*"]

View File

@ -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