Custom modules are small Go plugins built against the conflux/module SDK. A minimal module implements three methods: Check, Diff, and Apply.
package main
import "conflux/module"
type TimezoneModule struct {
Zone string `yaml:"zone"`
}
func (m *TimezoneModule) Check(h module.Host) (bool, error) {
current, err := h.Run("timedatectl show -p Timezone --value")
if err != nil {
return false, err
}
return current == m.Zone, nil
}
func (m *TimezoneModule) Apply(h module.Host) error {
_, err := h.Run("timedatectl set-timezone " + m.Zone)
return err
}
func main() {
module.Serve(&TimezoneModule{})
}Build it and drop the binary into ~/.config/conflux/modules/:
go build -o ~/.config/conflux/modules/timezone ./timezoneReference it in a playbook exactly like a built-in module:
modules:
- timezone:
zone: "Europe/Berlin"Conflux discovers anything in the modules directory automatically at startup — no registration step needed.