Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • G ganeti
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 3
    • Issues 3
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Shared puppet modules group
  • ganeti
  • Issues
  • #7

Closed
Open
Created May 04, 2020 by Antoine Beaupré@anarcatOwner

allow overriding debootstrap parameters

In the light of the buster change to usrmerge, I feel the need to pass extra, arbitrary arguments to debootstrap. This is currently not supported by ganeti-instance-deboostrap itself but I found a workaround; by adding this to my variants.conf (e.g. variants/buster.conf) file:

debootstrap() {
    /usr/sbin/debootstrap --no-merged-usr "$@"
}

... I can override how the debootstrap command runs, because the variants.conf files are just sourced by the create command in ganeti-instance-debootsrap (which is just a shell script).

Yes, that's ugly as hell. But no, there's no way around this, unless we patch ganeti-instance-deboostrap. My previous experience with that did not work so well, so I doubt that's a good way forward.

This, by the way, would allow us to use faster bootstrapping tools like mmdebstrap as well, which shouldn't be neglected.

Unfortunately, the way this module is structured right now, we can't pass extra parameters like this in the variants files. At most we can define extra arbitrary variables, but not arbitrary shell code like this.

I feel the Ganeti::Variant type is a little over-engineered and too tightly coupled with the ganeti-instance-deboostrap code. Whenever a new variable gets added or removed in the latter, we need to update the former. And we can't do customizations like that easily.

I would like to introduce a new variable in that type, maybe:

Optional[extra_code] => String[1],

... and just inject the hell out of this thing directly in the config. The variant would therefore look like:

class { 'ganeti':
    debootstrap_variants => {
        'buster+nomerge': {
            'extra_code': "debootstrap() { /usr/sbin/debootstrap --no-merged-usr "$@" }\n",
        }
    },
}

Yes, that's ugly as hell. But no, I can't find another way.

Any other brilliant ideas before I submit this as a MR?

Thanks!

Assignee
Assign to
Time tracking