Page MenuHomeDevCentral

Initial revision
ClosedPublic

Authored by dereckson on Oct 2 2017, 23:40.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 18, 00:02
Unknown Object (File)
Wed, Apr 17, 22:52
Unknown Object (File)
Sun, Apr 14, 10:30
Unknown Object (File)
Sun, Apr 14, 08:51
Unknown Object (File)
Mon, Apr 8, 22:26
Unknown Object (File)
Wed, Apr 3, 12:13
Unknown Object (File)
Fri, Mar 29, 03:44
Unknown Object (File)
Fri, Mar 29, 03:00
Subscribers

Details

Summary

To run several masters on one server, we provide different
configuration directories, and map staging directories to
them.

The salt-get-config-dir command gives the config dir to
use in stdout, or return 1 as exit code if that can't be
determined.

The salt-wrapper command generates the proper salt
command prepending sudo and appending --config-dir.

Examples:

  • salt-wrapper salt-call --local test.ping
  • salt-wrapper salt '*' state.highstate

The map is stored in /usr/local/etc/salt-wrapper.conf
as a JSON document containing a roots array, each entry
an object with config and states property:

{
    "roots": [
        {
            "config": "/usr/local/etc/salt-woodscloud",
            "states": "/opt/woodscloud-operations"
        },
        {
            "config": "/usr/local/etc/salt",
            "states": "/opt/nasqueron-operations"
        }
    ]
}
Test Plan

Run example salt and salt-call commands from /opt/nasqueron-operations
and /usr/local/etc/salt-woodscloud

Diff Detail

Repository
rSW salt-wrapper
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson added inline comments.
salt-get-config-dir.py
7

Proof of concept / that still needs a check if that exists, with a link to the documentation to help to write one.

Use Nasqueron header blocks

dereckson added a subscriber: xcombelle.

@xcombelle notes we could switch the wrapper to a regular programming language, per the contains method.

This is a cost to pay to provide a wrapper in pure sh, and not target bash with the wrapper.

I'm a little reticent to call complicated command lines from Python and manage the stderr/stdin/stdout pipelines triplet,
but this is a welcome contribution if one wants to implement it.

This revision is now accepted and ready to land.Oct 4 2017, 11:50
This revision was automatically updated to reflect the committed changes.