Skip to content

Some form of "standard library"? #112

@08d2

Description

@08d2

I'm using makesure as a sort of ersatz Chef/Puppet/Ansible. Each Makesurefile defines how to install, start, and uninstall a versioned application on a host. Each of these high-level outcomes usually can be achieved with a small set of low-level primitives: a goal to fetch an artifact from a remote source, create a user,install a file, make a symlink, basic interactions with systemd, etc. So far, I've just been copying and pasting these goals between Makesurefiles, modifying the specific parameters directly. But it's now become enough repetition, and enough subtlety and complexity in each primitive goal, that copying and pasting isn't really working any more.

The core requirement here is, given N Makesurefiles with broadly similar structure and goals, to be able reduce each of those files to just the "important bits" so to speak. I want to say "install_file SRC DST OWNER MODE" without needing to re-define the steps required to do that work in each file.

The lib directive is a good step, but for this I think it's not quite sufficient. My approach at the moment is essentially a preprocessor, which transforms parameterized !goal directives to proper @goal expressions with a form of templating. This works, but I wanted to solicit your opinion on alternative approaches, or potentially new capabilities in the core tool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions