8000 GitHub - franzos/state-masssage: State Massage, massages the state, until it matches a given set of tasks.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

franzos/state-masssage

Repository files navigation

State Massage

State Massage, massages the state, until it matches a given set of tasks. Basically ansible, minus a lot of the features, plus speed. Not exactly fast, but much faster.

This is primarily for use on systems, that do not run guix, and thus, rely on massaging.

Usage

Define tasks

Tasks are defined in tasks.ini, and are run in order. Here's an example:

[task.21]
title = Create systemd service for Guix garbage collector
opt = copy
src = files/guix-gc.service
dest = /etc/systemd/system/guix-gc.service

[task.22]
title = Create systemd timer for Guix garbage collector
opt = copy
src = files/guix-gc.timer
dest = /etc/systemd/system/guix-gc.timer

[task.23]
title = Reload systemd and enable Guix garbage collector timer
opt = systemd
daemon_reload = yes
enabled = yes
state = started
name = guix-gc.timer

Unlike ansible, you can deprecate existing tasks, which simply means that they are reverted.

[task.26]
title = Reload systemd and enable Guix pull timer
opt = systemd
daemon_reload = yes
enabled = yes
state = started
name = guix-pull.timer
deprecated = yes

Two operations are supported:

  • copy: Copies a file from src to dest.
  • systemd: Performs a systemd operation.

Run CLI

  • --operation:
    • validate: Validates the tasks.
    • run: Runs the tasks.
    • dry-run: Simulates the tasks.
  • --tasks-path: Path to tasks (ini); defaults to $cwd/tasks.ini
  • --copy-dest: Defaults to whatever is defined in your tasks. Overwrite for testing...
state-massage --operation run

One-liner on guix:

guix shell python -- python3 -m state_massage.main --operation dry-run

Tests

You need to use Docker to run tests, because they rely on systemd:

python3 run-tests.py

About

State Massage, massages the state, until it matches a given set of tasks.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0