Skip to content

Commit

Permalink
[icinga_db] Don't install dbconfig-no-thanks
Browse files Browse the repository at this point in the history
As discussed in #2295, dbconfig-no-thanks
will disable dbconfig on a system-wide basis. This patch implements a more
fine-grained approach by disabling dbconfig only for certain packages.
  • Loading branch information
Alphix committed Oct 15, 2023
1 parent a4aa669 commit 8a0a84d
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
3 changes: 0 additions & 3 deletions ansible/roles/icinga_db/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,6 @@ icinga_db__ssl_ca_certificate: '{{ icinga_db__pki_path + "/"
#
# The list of APT packages to install for Icinga 2 database support.
icinga_db__base_packages:

# Disable dbconfig support, DebOps roles will handle the Icinga database
- 'dbconfig-no-thanks'
- '{{ "icinga2-ido-" + icinga_db__ido }}'

# ]]]
Expand Down
18 changes: 18 additions & 0 deletions ansible/roles/icinga_db/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,24 @@
run_once: True
delegate_to: 'localhost'

- name: Make sure that the dbconfig directory exists
ansible.builtin.file:
path: '/etc/dbconfig-common'
state: 'directory'
owner: 'root'
group: 'root'
mode: '0755'
when: icinga_db__icinga_installed | bool

- name: Disable dbconfig for package icinga2-ido-{{ icinga_db__ido }}
ansible.builtin.template:
src: 'etc/dbconfig-common/icinga2-ido.conf.j2'
dest: '/etc/dbconfig-common/icinga2-ido-{{ icinga_db__ido }}.conf'
owner: 'root'
group: 'root'
mode: '0600'
when: icinga_db__icinga_installed | bool

- name: Install required packages
ansible.builtin.package:
name: '{{ q("flattened", icinga_db__base_packages + icinga_db__packages) }}'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{# Copyright (C) 2023 David Härdeman <[email protected]>
# Copyright (C) 2023 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
#}

#
# dbconfig interferes with the database management carried out by the DebOps
# icinga_db Ansible role, so we need to disable dbconfig.
#
# See https://github.com/debops/debops/pull/2295 for details.
#
# {{ ansible_managed }}
#

# dbc_install: configure database with dbconfig-common?
# set to anything but "true" to opt out of assistance
dbc_install='false'

# dbc_upgrade: upgrade database with dbconfig-common?
# set to anything but "true" to opt out of assistance
dbc_upgrade='false'

# dbc_remove: deconfigure database with dbconfig-common?
# set to anything but "true" to opt out of assistance
dbc_remove='false'

0 comments on commit 8a0a84d

Please sign in to comment.