Page MenuHomeDevCentral

Initial revision
ClosedPublic

Authored by dereckson on Oct 2 2017, 23:40.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 02:52
Unknown Object (File)
Thu, Nov 14, 19:42
Unknown Object (File)
Tue, Nov 12, 10:20
Unknown Object (File)
Tue, Nov 12, 06:20
Unknown Object (File)
Tue, Nov 12, 05:58
Unknown Object (File)
Tue, Nov 12, 03:34
Unknown Object (File)
Sat, Nov 9, 05:10
Unknown Object (File)
Sat, Nov 9, 04:05
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.