~freebsd-update.yml, ~inventory.yml

-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
+7 -24
inventory.yml
···
ansible_user: jas
ansible_host: desktop.carp-wyvern.ts.net
ansible_python_interpreter: /usr/bin/python3
-
hyperreal:
-
ansible_user: jas
-
ansible_host: hyperreal.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/local/bin/python3.11
debian_servers:
hosts:
-
hyperreal:
-
ansible_user: jas
-
ansible_host: hyperreal.carp-wyvern.ts.net
-
ansible_python_interpreter: /usr/bin/python3
-
aux:
+
moonshadow:
ansible_user: jas
-
ansible_host: aux.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_clients:
-
children:
-
debian_servers:
-
prom_servers:
-
hosts:
-
aux:
-
ansible_user: jas
-
ansible_host: aux.carp-wyvern.ts.net
-
ansible_python_interpreter: /usr/bin/python3
-
remote_logging_clients:
-
children:
-
debian_servers:
-
freebsd_servers:
+
tornode:
+
ansible_user: root
+
ansible_host: tornode
+
ansible_python_interpreter: /usr/local/bin/python3.11