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 * collectd: fix rights for collectd directory
* etc-git: Remove deprecated/unsupported "warn" parameter * etc-git: Remove deprecated/unsupported "warn" parameter
* ospf, bgp: fix checks scripts * 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 ### 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: tags:
- pkg - 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)" - name: "Install packages (vim rsync mtr etc)"
community.general.openbsd_pkg: include: openbsd_pkg_custom.yml
name: vars:
- wget package: "{{ item }}"
- vim--no_x11 loop:
- rsync-- - wget
- mtr-- - vim--no_x11
- iftop - rsync--
- sudo-- - mtr--
- bash - iftop
- ncdu - sudo--
- htop - bash
ignore_errors: true - ncdu
- htop
tags: tags:
- pkg - pkg

View file

@ -1,8 +1,25 @@
# yamllint disable rule:line-length # yamllint disable rule:line-length
--- ---
- name: "Install Collectd package" # openbsd_pkg is broken since OpenBSD 7.4 with the version of Ansible we currently use
community.general.openbsd_pkg: #- name: "Install Collectd package"
name: "collectd" # 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: tags:
- collectd - collectd

View file

@ -1,9 +1,26 @@
--- ---
- name: "Git is installed" # openbsd_pkg is broken since OpenBSD 7.4 with the version of Ansible we currently use
community.general.openbsd_pkg: #- name: "Git is installed"
name: git # community.general.openbsd_pkg:
state: present # 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: tags:
- etc-git - etc-git

View file

@ -1,9 +1,26 @@
--- ---
- name: "Install logsentry" # openbsd_pkg is broken since OpenBSD 7.4 with the version of Ansible we currently use
community.general.openbsd_pkg: #- name: "Install logsentry"
name: # community.general.openbsd_pkg:
- logsentry-- # name:
state: present # - 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: tags:
- logsentry - logsentry

View file

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