EvoBSD/roles/base/tasks/openbsd_pkg_custom.yml
Jérémy Dubois 99ff7284a3 base, collectd, etc-git, logsentry, nagios-nrpe: install packages manually
Because openbsd_pkg module is broken since OpenBSD 7.4 with the version of Ansible we currently use
2024-03-13 15:17:20 +01:00

18 lines
377 B
YAML

---
- name: "Check if {{ package }} is already installed"
ansible.builtin.command:
cmd: pkg_info -Iq inst:{{ package }}
register: is_installed
ignore_errors: true
changed_when: false
tags:
- pkg
- name: "Install {{ package }}"
ansible.builtin.command:
cmd: pkg_add {{ package }}
when: "'Can\\'t find inst:' in is_installed.stderr"
tags:
- pkg