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

Move the upgrade logic outside of Chef #219

Open
tas50 opened this issue Nov 30, 2020 · 0 comments
Open

Move the upgrade logic outside of Chef #219

tas50 opened this issue Nov 30, 2020 · 0 comments

Comments

@tas50
Copy link
Contributor

tas50 commented Nov 30, 2020

Having Chef upgrade itself is problematic and at this point we need to hit the reset button and try something different. Instead of having Chef determine if an upgrade is necessary and then run the upgrade we should have Chef determine if the upgrade is necessary and then kick off a script via a system scheduler to perform the upgrade.

  • Determine if an upgrade is necessary
  • Download the new version package
  • Lay down an upgrade script in /opt/chef_infra_updater or C:\opscode\chef_infra_updater
    • This will be templated to include values such as the lockfile and the location of the new version package
  • Schedule a task to run the upgrade script 2 minutes in the future
    • launchd on macos (1 time daemon using RunAtLoad config)
    • cron on solaris/aix/freebsd (remove post upgrade)
    • scheduled task: Windows
    • systemd timer on Linux
  • Exit Chef Run with upgrade exit code (yet to be determined)
  • Script executes:
    • Kill any running chef processes
    • Add a run lock file
    • Delete Chef dir (to avoid chef_gem mess)
    • Install the new version
    • Nuke the run lock
    • Run Chef Infra Client so legacy service based chef-clients can be started back up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant