Page MenuHomeDevCentral

Initial revision
ClosedPublic

Authored by dereckson on Oct 2 2017, 23:40.
Tags
None
Referenced Files
F3928550: D1023.id2611.diff
Sun, Dec 22, 05:28
Unknown Object (File)
Wed, Dec 18, 06:02
Unknown Object (File)
Wed, Dec 11, 23:48
Unknown Object (File)
Wed, Dec 11, 02:44
Unknown Object (File)
Tue, Dec 10, 04:15
Unknown Object (File)
Mon, Dec 9, 08:47
Unknown Object (File)
Thu, Dec 5, 02:09
Unknown Object (File)
Thu, Dec 5, 00:51
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.