Compare changes

Choose any two refs to compare.

-8
freebsd-update.yml
···
-
---
- hosts: freebsd_servers
gather_facts: true
become: true
-
tasks:
- name: Update all installed packages
community.general.pkgng:
name: "*"
state: latest
-
- name: Update the base system
ansible.builtin.shell: freebsd-update fetch install --not-running-from-cron
-
- name: Get currently running FreeBSD kernel version in memory
ansible.builtin.shell: freebsd-version -r
register: running_kv
-
- name: Get newly installed kernel version
ansible.builtin.shell: freebsd-version -k
register: installed_kv
-
- name: Check for kernel version mismatch
set_fact:
reboot_required: "{{ running_kv.stdout != installed_kv.stdout }}"
-
- name: Display reboot status
ansible.builtin.debug:
msg: "Reboot required: {{ reboot_required }}"
-
- name: Reboot the FreeBSD server if needed
ansible.builtin.reboot:
reboot_timeout: 3600
+10 -35
inventory.yml
···
borgmatic_hosts:
hosts:
-
hyperreal:
+
desktop:
ansible_user: jas
-
ansible_host: hyperreal.carp-wyvern.ts.net
+
ansible_host: desktop.carp-wyvern.ts.net
ansible_python_interpreter: /usr/bin/python3
nas:
ansible_user: jas
ansible_host: nas.carp-wyvern.ts.net
-
ansible_python_interpreter: /usr/bin/python3
-
dietpi:
-
ansible_user: jas
-
ansible_host: dietpi.carp-wyvern.ts.net
-
ansible_python_interpreter: /usr/bin/python3
+
ansible_python_interpreter: /usr/local/bin/python3.11
debian_servers:
hosts:
-
dietpi:
-
ansible_user: dietpi
-
ansible_host: dietpi.carp-wyvern.ts.net
-
ansible_python_interpreter: /usr/bin/python3
-
hyperreal:
+
moonshadow:
ansible_user: jas
-
ansible_host: hyperreal.carp-wyvern.ts.net
-
ansible_python_interpreter: /usr/bin/python3
-
nas-aux:
-
ansible_user: jas
-
ansible_host: nas-aux.carp-wyvern.ts.net
-
ansible_python_interpreter: /usr/bin/python3
-
aux-remote:
-
ansible_user: jas
-
ansible_host: aux-remote.carp-wyvern.ts.net
+
ansible_host: moonshadow.carp-wyvern.ts.net
ansible_python_interpreter: /usr/bin/python3
freebsd_servers:
hosts:
nas:
-
ansible_user: jas
+
ansible_user: root
ansible_host: nas.carp-wyvern.ts.net
ansible_python_interpreter: /usr/local/bin/python3.11
-
prom_servers:
-
hosts:
-
nas-aux:
-
ansible_user: jas
-
ansible_host: nas-aux.carp-wyvern.ts.net
-
ansible_python_interpreter: /usr/bin/python3
-
prom_clients:
-
children:
-
debian_servers:
-
remote_logging_clients:
-
children:
-
debian_servers:
-
freebsd_servers:
+
tornode:
+
ansible_user: root
+
ansible_host: tornode
+
ansible_python_interpreter: /usr/local/bin/python3.11
+19 -42
remote-logging-setup.yml
···
gather_facts: true
become: true
tasks:
-
- name: Ensure syslog-ng is installed
+
- name: Ensure rsyslog is installed
ansible.builtin.package:
-
name: syslog-ng
+
name: rsyslog
state: latest
when: ansible_system == "Linux"
-
- name: Ensure syslog-ng is enabled
+
- name: Ensure rsyslog is enabled
ansible.builtin.systemd_service:
-
name: syslog-ng
+
name: rsyslog
enabled: true
state: started
when: ansible_service_mgr == "systemd"
- name: Remove any forwarding file if exists
ansible.builtin.file:
-
path: /etc/syslog-ng/conf.d/forward.conf
+
path: /etc/rsyslog.d/forward.conf
state: absent
when: ansible_system == "Linux"
-
- name: Get remote logging server tailnet IP address
-
ansible.builtin.shell: tailscale status | grep "nas-aux" | awk '{print $1}'
-
register: ctrl_tailnet_ip_addr
+
- name: Get remote logging server headnet IP address
+
ansible.builtin.shell: tailscale status | grep "aux" | awk '{print $1}'
+
register: ctrl_headnet_ip_addr
changed_when: false
-
failed_when: ctrl_tailnet_ip_addr.rc != 0
-
- name: Configure log forwarding (Debian)
+
failed_when: ctrl_headnet_ip_addr.rc != 0
+
- name: Configure log forwarding
ansible.builtin.blockinfile:
-
path: /etc/syslog-ng/conf.d/forward.conf
+
path: /etc/rsyslog.d/forward.conf
create: true
owner: root
group: root
mode: 0644
block: |
-
# Forward to nas-aux ({{ctrl_tailnet_ip_addr.stdout}})
-
destination d_ewmm {
-
syslog-ng(server("{{ctrl_tailnet_ip_addr.stdout}}"));
-
};
-
-
log {
-
source(s_src);
-
destination(d_ewmm);
-
};
-
when: ansible_os_family == "Debian"
-
- name: Configure log forwarding (Red Hat)
-
ansible.builtin.blockinfile:
-
path: /etc/syslog-ng/conf.d/forward.conf
-
create: true
-
owner: root
-
group: root
-
mode: 0644
-
block: |
-
# Forward to nas-aux ({{ctrl_tailnet_ip_addr.stdout}})
-
destination d_ewmm {
-
syslog-ng(server("{{ctrl_tailnet_ip_addr.stdout}}"));
-
};
-
-
log {
-
source(s_sys);
-
destination(d_ewmm);
-
};
-
when: ansible_os_family == "RedHat"
-
- name: Restart syslog-ng
+
# Forward to aux.carp-wyvern.ts.net ({{ctrl_headnet_ip_addr.stdout}})
+
*.* action(type="omfwd" target="{{ctrl_headnet_ip_addr.stdout}}" port="514" protocol="tcp"
+
action.resumeRetryCount="100"
+
queue.type="linkedList" queue.size="10000")
+
when: ansible_system == "Linux"
+
- name: Restart rsyslog
ansible.builtin.systemd_service:
-
name: syslog-ng
+
name: rsyslog
enabled: true
state: restarted
when: ansible_service_mgr == "systemd"
···
ansible.builtin.lineinfile:
path: /etc/syslog.conf
regexp: '^\*\.\*'
-
line: "*.* @{{ctrl_tailnet_ip_addr.stdout}}"
+
line: "*.* @{{ctrl_headnet_ip_addr.stdout}}"
owner: root
group: wheel
mode: 0644