Jérémy Dubois
99ff7284a3
Because openbsd_pkg module is broken since OpenBSD 7.4 with the version of Ansible we currently use
18 lines
377 B
YAML
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
|