Issues with preseeding dbconfig

There’s an interesting side effect to way Debian-like systems handle the database configuration for various packages. Instead of each package setting the connection parameters on their own, they reuse the abstraction provided by package ‘dbconfig-common’. This is all fine in theory, but unfortunately dbconfig doesn’t seem to behave very well with values pre-set before installation.

It should check the debconf settings called “\<package>/internal/skip-preseed” and ignore all the setup and leave the configuration up to other tools. (configuration management!) But that’s not what happens at the start. For example package “phpmyadmin” - it depends on “dbconfig-common” and I didn’t want to this way of configuration. But here’s the catch: setting “phpmyadmin/internal/skip-preseed” to “true” didn’t work. The package is installed with a randomly generated password.

There’s a way to work around this by splitting the installation into steps though. First install “dbconfig-common”, then set the values, then install the package. The way it works in salt (for example) is:

dbconfig-common:
  pkg.installed
phpmyadmin:
  pkg:
    - installed
    - require:
      - debconf: phpmyadmin
  debconf.set:
    - require:
      - pkg: dbconfig-common
    - data:
        'phpmyadmin/internal/skip-preseed':
          type: boolean
          value: true

Then it all works again. Hopefully also for packages other than phpmyadmin.

Was it useful? BTC: 182DVfre4E7WNk3Qakc4aK7bh4fch51hTY

blogroll

social