Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update bootstrap to use mixlib-install #8468

Open
marcparadise opened this issue May 6, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@marcparadise
Copy link
Member

commented May 6, 2019

Current Process

  1. Bootstrap template (chef-full or windows-chef-client-msi.erb)
    contains platform-specific methods for downloading the chef client.
    It is rendered locally and uploaded to the target host.
  2. The rendered script is run on the target host:
    a) check for any installed version of Chef.
    b) If missing, download chef-client and install it.
    c) run initial converge.

New Process

We'll move the download/install behaviors out of the bootstrap
template and into the bootstrap command using mixlib-install.

  1. Generate the remote install command and using mixlib install:
    a) Mixlib::Install.new(options).install_command
    b) Populate mixlib-install options using data available from the bootstrap TrainConnector; they are documented in the
    mixlib-install README.md.
    c) Ensure that install_strategy is set to once to preserve the existing behavior
    of not installing Chef Infra Client if it is already installed.
    d) Proxy configuration must be supplied to ensure the generated script follows proxy rules. These are set via install_command_options.
  2. Prior to generating the template, use connection.upload_file_content to upload
    the install command as a script
  3. Notify the human that we're installing chef, then run the uploaded script
  4. Render bootstrap template, upload and execute as today.

The bootstrap templates will have installation-related behaviors
removed from them.

New CLI Options

  • --bootstrap-[no-]install - skip the installation step. Defaults to true. When false, skip the install. The corresponding key bootstrap_install will be supported in config as well so that it can be defaulted in user settings.
  • --bootstrap-metadata-url - this probably needs a better name. If present this is provided as an override_url to mixlib-cli to ensure that the customer's preferred omnitruck metadata API URL is used.

The corresponding config keys will be supported in config (knife.rb)

Downstream Impact

  • customer custom bootstrap templates - these will already have their own logic for installing. --bootstrap-no-install is intended to mitigate this
  • plugins that override or extend bootstrap behavior - this is less clear. None of the public API is modified, but this adds new behavior that occurs when Bootstrap#run is invoked.
@btm

This comment has been minimized.

Copy link
Member

commented May 7, 2019

We need to consider users that have forked the chef-full bootstrap template to run custom commands as part of the install process. Is it enough if bootstrap had pre-install/post-install hooks of some other kind, or would the change have to be in mixlib-install?

@marcparadise

This comment has been minimized.

Copy link
Member Author

commented May 7, 2019

Ideally we'd split all of stuff in bootstrap template into hookable steps, though that's beyond scope of this change.

Outside of that, if someone does have a forked template using the --bootstrap-no-install flag would suppress the install behavior - so their existing template wouldn't be required to change.

@marcparadise

This comment has been minimized.

Copy link
Member Author

commented May 8, 2019

One thing that'll stil be a problem is usage of a custom package download URL - that means we will still have to maintain the scripts that know how to download things on unix/windows (wget.vbs, do_download() from download.sh).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.