mirror of
https://github.com/RWejlgaard/pez-infra.git
synced 2026-05-06 04:14:43 +00:00
24 lines
845 B
YAML
24 lines
845 B
YAML
---
|
|
# Update FreeBSD hosts only (pkg).
|
|
# Usage: ansible-playbook playbooks/update-freebsd.yml
|
|
#
|
|
# Equivalent to: ansible-playbook playbooks/update-all.yml --tags freebsd
|
|
# This is a convenience wrapper for when you only want FreeBSD hosts.
|
|
|
|
- name: Update FreeBSD hosts (pkg)
|
|
hosts: freebsd
|
|
ignore_unreachable: true
|
|
tasks:
|
|
- name: Pkg update
|
|
ansible.builtin.command: pkg update -f
|
|
register: pkg_update_result
|
|
changed_when: "'Updating' in pkg_update_result.stdout"
|
|
|
|
- name: Pkg upgrade
|
|
ansible.builtin.command: pkg upgrade -y
|
|
register: pkg_upgrade_result
|
|
changed_when: "'upgraded' in pkg_upgrade_result.stdout or 'installed' in pkg_upgrade_result.stdout"
|
|
|
|
- name: Show upgrade summary
|
|
ansible.builtin.debug:
|
|
msg: "{{ pkg_upgrade_result.stdout_lines | default(['No output']) }}"
|