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
This commit is contained in:
Jérémy Dubois 2024-03-13 15:16:50 +01:00
parent 6a2faf5649
commit 99ff7284a3
8 changed files with 151 additions and 37 deletions

View file

@ -103,6 +103,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* collectd: fix rights for collectd directory
* etc-git: Remove deprecated/unsupported "warn" parameter
* ospf, bgp: fix checks scripts
* 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
### Removed

View file

@ -0,0 +1,17 @@
---
- 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

View file

@ -8,19 +8,37 @@
tags:
- pkg
# openbsd_pkg is broken since OpenBSD 7.4 with the version of Ansible we currently use
#- name: "Install packages (vim rsync mtr etc)"
# community.general.openbsd_pkg:
# name:
# - wget
# - vim--no_x11
# - rsync--
# - mtr--
# - iftop
# - sudo--
# - bash
# - ncdu
# - htop
# ignore_errors: true
# tags:
# - pkg
- name: "Install packages (vim rsync mtr etc)"
community.general.openbsd_pkg:
name:
- wget
- vim--no_x11
- rsync--
- mtr--
- iftop
- sudo--
- bash
- ncdu
- htop
ignore_errors: true
include: openbsd_pkg_custom.yml
vars:
package: "{{ item }}"
loop:
- wget
- vim--no_x11
- rsync--
- mtr--
- iftop
- sudo--
- bash
- ncdu
- htop
tags:
- pkg

View file

@ -1,8 +1,25 @@
# yamllint disable rule:line-length
---
- name: "Install Collectd package"
community.general.openbsd_pkg:
name: "collectd"
# openbsd_pkg is broken since OpenBSD 7.4 with the version of Ansible we currently use
#- name: "Install Collectd package"
# community.general.openbsd_pkg:
# name: "collectd"
# tags:
# - collectd
- name: "Check if collectd is already installed"
ansible.builtin.command:
cmd: pkg_info -Iq inst:collectd
register: is_installed
ignore_errors: true
changed_when: false
tags:
- collectd
- name: "Install collectd"
ansible.builtin.command:
cmd: pkg_add collectd
when: "'Can\\'t find inst:' in is_installed.stderr"
tags:
- collectd

View file

@ -1,9 +1,26 @@
---
- name: "Git is installed"
community.general.openbsd_pkg:
name: git
state: present
# openbsd_pkg is broken since OpenBSD 7.4 with the version of Ansible we currently use
#- name: "Git is installed"
# community.general.openbsd_pkg:
# name: git
# state: present
# tags:
# - etc-git
- name: "Check if git is already installed"
ansible.builtin.command:
cmd: pkg_info -Iq inst:git
register: is_installed
ignore_errors: true
changed_when: false
tags:
- etc-git
- name: "Install git"
ansible.builtin.command:
cmd: pkg_add git
when: "'Can\\'t find inst:' in is_installed.stderr"
tags:
- etc-git

View file

@ -1,9 +1,26 @@
---
- name: "Install logsentry"
community.general.openbsd_pkg:
name:
- logsentry--
state: present
# openbsd_pkg is broken since OpenBSD 7.4 with the version of Ansible we currently use
#- name: "Install logsentry"
# community.general.openbsd_pkg:
# name:
# - logsentry--
# state: present
# tags:
# - logsentry
- name: "Check if logsentry-- is already installed"
ansible.builtin.command:
cmd: pkg_info -Iq inst:logsentry--
register: is_installed
ignore_errors: true
changed_when: false
tags:
- logsentry
- name: "Install logsentry--"
ansible.builtin.command:
cmd: pkg_add logsentry--
when: "'Can\\'t find inst:' in is_installed.stderr"
tags:
- logsentry

View file

@ -1,19 +1,31 @@
# yamllint disable rule:line-length
---
- name: "Install nrpe"
community.general.openbsd_pkg:
name:
- nrpe--
state: present
tags:
- nagios-nrpe
# openbsd_pkg is broken since OpenBSD 7.4 with the version of Ansible we currently use
#- name: "Install nrpe"
# community.general.openbsd_pkg:
# name:
# - nrpe--
# state: present
# tags:
# - nagios-nrpe
#
#- name: "Install monitoring packages"
# community.general.openbsd_pkg:
# name:
# - monitoring-plugins
# - check_bioctl
# state: present
# tags:
# - nagios-nrpe
- name: "Install monitoring packages"
community.general.openbsd_pkg:
name:
- monitoring-plugins
- check_bioctl
state: present
- name: "Install nrpe and monitoring packages"
include: openbsd_pkg_custom.yml
vars:
package: "{{ item }}"
loop:
- nrpe--
- monitoring-plugins
- check_bioctl
tags:
- nagios-nrpe

View file

@ -0,0 +1,15 @@
- 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:
- nagios-nrpe
- name: "Install {{ package }}"
ansible.builtin.command:
cmd: pkg_add {{ package }}
when: "'Can\\'t find inst:' in is_installed.stderr"
tags:
- nagios-nrpe