Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
lessonsprovisioning area, parallel to the existing Chef/Ansible/Puppet/Salt ones, implemented once inconfigbox/cfengine/shared_policy/lessons/(a delivery-agnostic bundle library reading a CFEngine augments variable,def.lessons) and consumed two ways:standalone/- masterless:cf-agent -Kf promises.cfapplied directly, no policy hub involved at all.hub/- the guest bootstraps to itself (cf-agent --bootstrap 127.0.0.1) and runs as its own self-hosted policy hub overcf-serverd- the same self-targeting trick this repo already uses for Salt's roster/dynamic trees and Ansible'sansible_local, so no second machine is ever needed.scriptbox/scripts/generate_cfengine.rb, reading the samescriptbox/config/*.ymlsource of truth as every other tool, emitting a CFEngine augmentsdef.json. Pre-aggregates everyappend-typed step's lines per destination file in Ruby (extract_appends!) before serializing, rather than one promise per originating step - see the "notable bugs found" section below for why that's load-bearing, not just tidier..module-vendor/apt/, demonstrated via a newapt_pinstep type that pins an already-installed apt package to an exact version/priority - additive to the existinggostep's plain apt+PPA install, not a replacement, opt-in via--select cfengine_apt_pin.cmpaths.toml,Rakefile(generate:cfengine), and.gitignoreupdated consistently with the existing Puppet/Salt conventions.Notable bugs found and fixed along the way (all confirmed via live
cf-agentruns, several only surfaced on a genuinely fresh VM - see test plan)scope => "bundle"on every per-step dispatch class, or the first step with e.g. anadd_apt_repoleft that class stuck true for every later step.data =>variable re-derived once per value of an outer slist only actually resolves for that slist's first value, silently keeping stale data for every later iteration - fixed by passing a plain string path into the shared dispatcher bundle instead of an extracted container, so its ownmergedata()lookup is genuinely local to each call.files:promise creating a directory needs a trailing/.on the promiser - without it,create => "true"on a missing path creates a plain file instead, invisible on a box where that directory already happened to exist from an earlier debugging run, but reproducible immediately from a truly fresh VM.hubtree's own/var/cfengine/inputs(whatcf-agentactually reads) never gets refreshed from/var/cfengine/masterfiles(what a hub serves) after the very first bootstrap, since we don't pull in the standard Masterfiles Policy Framework's ownupdate.cfbundle - fixed with an explicit sync in the hub bootstrap script on every provision.Test plan
standalone/-vagrant upand a subsequentvagrant provisionboth converge cleanly (55/56+ steps depending on tag selection); every MVP-scope step type (apt/apt_repository/add_apt_repo, apt_pin, sysctl, file, append, script) verified installing correctly viaverify_commands.rbhub/- verified twice: a fullvagrant destroy && vagrant upfrom a completely blank VM, and avagrant provisionre-run against an already-converged box - both clean, matchingstandalone's own results exactlyapt_pin- verified end-to-end with--select cfengine_apt_pin: the vendored module writes a correct/etc/apt/preferences.d/golang-go, andapt-cache policyconfirms the pin is genuinely active (priority 1001 replacing the default 500), not just coincidentally matching the newest available versionrake test- all existing tests pass unchanged;rake generate:allconfirmed to produce byte-identical output for Puppet/Chef/Ansible/Salt (no regressions)file-type step and multipleappend-type steps both targeting.zshrccauses thefilestep to silently wipe whatever the append steps inserted (already flagged for Salt) - a redesign (treating the zsh baseline as its ownappendentry instead of a competing whole-file replace) is planned as a separate follow-up branch/PR🤖 Generated with Claude Code