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:
parent
6a2faf5649
commit
99ff7284a3
|
@ -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
|
||||
|
||||
|
|
17
roles/base/tasks/openbsd_pkg_custom.yml
Normal file
17
roles/base/tasks/openbsd_pkg_custom.yml
Normal 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
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
15
roles/nagios-nrpe/tasks/openbsd_pkg_custom.yml
Normal file
15
roles/nagios-nrpe/tasks/openbsd_pkg_custom.yml
Normal 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
|
Loading…
Reference in a new issue