Salt SProxy
===========
Salt plugin for interacting with network devices, without running Minions.
.. note::
This is NOT a SaltStack product.
Install
-------
Install this package where you would like to manage your devices from. In case
you need a specific Salt version, make sure you install it beforehand,
otherwise this package will bring the latest Salt version available instead.
The package is distributed via PyPI, under the name ``salt-sproxy``.
Execute:
.. code-block:: bash
pip install salt-sproxy
Documentation
-------------
The complete documentation is available at
https://salt-sproxy.readthedocs.io/en/latest/.
Usage
-----
First off, make sure you have the Salt `Pillar Top file
<https://docs.saltstack.com/en/latest/ref/states/top.html>`_ correctly defined
and the ``proxy`` key is available into the Pillar. For more in-depth
explanation and examples, check `this
<https://docs.saltstack.com/en/latest/topics/proxyminion/index.html>`_ tutorial
from the official SaltStack docs.
Once you have that, you can start using ``salt-sproxy`` even without any Proxy
Minions or Salt Master running. To check, can start by executing:
.. code-block:: bash
$ salt-sproxy -L a,b,c --preview-target
- a
- b
- c
The syntax is very similar to the widely used CLI command ``salt``, however the
way it works is completely different under the hood:
``salt-sproxy <target> <function> [<arguments>]``
Usgae Example:
.. code-block:: bash
$ salt-sproxy cr1.thn.lon test.ping
cr1.thn.lon:
True
One of the most important differences between ``salt`` and ``salt-sproxy`` is
that the former is aware of the devices available, thanks to the fact that the
Minions connect to the Master, therefore ``salt`` has the list of targets
already available. ``salt-sproxy`` does not have this, as it doesn't require
the Proxy Minions to be up and connected to the Master. For this reason, you
will need to provide it a list of devices, or a `Roster file
<https://docs.saltstack.com/en/latest/topics/ssh/roster.html>`_ that provides
the list of available devices.
The following targeting options are available:
- ``-E``, ``--pcre``: Instead of using shell globs to evaluate the target
servers, use pcre regular expressions.
- ``-L``, ``--list``: Instead of using shell globs to evaluate the target
servers, take a comma or space delimited list of servers.
- ``-G``, ``--grain``: Instead of using shell globs to evaluate the target
use a grain value to identify targets, the syntax for the target is the grain
key followed by a globexpression: ``"os:Arch*"``.
- ``-P``, ``--grain-pcre``: Instead of using shell globs to evaluate the target
use a grain value to identify targets, the syntax for the target is the grain
key followed by a pcre regular expression: "os:Arch.*".
- ``-N``, ``--nodegroup``: Instead of using shell globs to evaluate the target
use one of the predefined nodegroups to identify a list of targets.
- ``-R``, ``--range``: Instead of using shell globs to evaluate the target
use a range expression to identify targets. Range expressions look like
%cluster.
.. warning::
Some of the targeting options above may not be available for some Roster
modules.
To use a specific Roster, configure the ``proxy_roster`` option into your
Master config file, e.g.,
.. code-block:: yaml
proxy_roster: ansible
With the configuration above, ``salt-sproxy`` would try to use the `ansbile
Roster module
<https://docs.saltstack.com/en/latest/ref/roster/all/salt.roster.ansible.html#module-salt.roster.ansible>`_
to compile the Roster file (typically ``/etc/salt/roster``) which is structured
as a regular Ansible Inventory file. This inventory should only provide the
list of devices.
The Roster can also be specified on the fly, using the ``-R`` or ``--roster``
options, e.g., ``salt-sproxy cr1.thn.lon test.ping --roster=flat``. In this
example, we'd be using the `flat Roster module
<https://docs.saltstack.com/en/latest/ref/roster/all/salt.roster.flat.html#module-salt.roster.flat>`_
to determine the list of devices matched by a specific target.
When you don't specify the Roster into the Master config, or from the CLI, you
can use ``salt-sproxy`` to target on or more devices using the ``glob`` or
``list`` target types, e.g., ``salt-sproxy cr1.thn.lon test.ping`` (glob) or
``salt-sproxy -L cr1.thn.lon,cr2.thn.lon test.ping`` (to target a list of
devices, cr1.thn.lon and cr2.thn.lon, respectively).
Note that in any case (with or without the Roster), you will need to provide
a valid list of Minions.
Raw data
{
"_id": null,
"home_page": "https://github.com/mirceaulinic/salt-sproxy",
"name": "salt-sproxy",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "salt,network,automation,cli,proxy,minion,salt-extension",
"author": "Mircea Ulinic",
"author_email": "ping@mirceaulinic.net",
"download_url": "https://files.pythonhosted.org/packages/80/d4/865caa6c92566557bdfda37f9e3cdf243f9a9807bf04fb055c636dadd1ea/salt-sproxy-2023.8.0.tar.gz",
"platform": null,
"description": "Salt SProxy\n===========\n\nSalt plugin for interacting with network devices, without running Minions.\n\n.. note::\n\n This is NOT a SaltStack product.\n\nInstall\n-------\n\nInstall this package where you would like to manage your devices from. In case\nyou need a specific Salt version, make sure you install it beforehand, \notherwise this package will bring the latest Salt version available instead.\n\nThe package is distributed via PyPI, under the name ``salt-sproxy``.\n\nExecute:\n\n.. code-block:: bash\n\n pip install salt-sproxy\n\nDocumentation\n-------------\n\nThe complete documentation is available at \nhttps://salt-sproxy.readthedocs.io/en/latest/.\n\nUsage\n-----\n\nFirst off, make sure you have the Salt `Pillar Top file \n<https://docs.saltstack.com/en/latest/ref/states/top.html>`_ correctly defined\nand the ``proxy`` key is available into the Pillar. For more in-depth \nexplanation and examples, check `this \n<https://docs.saltstack.com/en/latest/topics/proxyminion/index.html>`_ tutorial \nfrom the official SaltStack docs.\n\nOnce you have that, you can start using ``salt-sproxy`` even without any Proxy\nMinions or Salt Master running. To check, can start by executing:\n\n.. code-block:: bash\n\n $ salt-sproxy -L a,b,c --preview-target\n - a\n - b\n - c\n\nThe syntax is very similar to the widely used CLI command ``salt``, however the\nway it works is completely different under the hood:\n\n``salt-sproxy <target> <function> [<arguments>]``\n\nUsgae Example:\n\n.. code-block:: bash\n\n $ salt-sproxy cr1.thn.lon test.ping\n cr1.thn.lon:\n True\n\nOne of the most important differences between ``salt`` and ``salt-sproxy`` is\nthat the former is aware of the devices available, thanks to the fact that the\nMinions connect to the Master, therefore ``salt`` has the list of targets \nalready available. ``salt-sproxy`` does not have this, as it doesn't require \nthe Proxy Minions to be up and connected to the Master. For this reason, you \nwill need to provide it a list of devices, or a `Roster file \n<https://docs.saltstack.com/en/latest/topics/ssh/roster.html>`_ that provides\nthe list of available devices.\n\nThe following targeting options are available:\n\n- ``-E``, ``--pcre``: Instead of using shell globs to evaluate the target\n servers, use pcre regular expressions.\n- ``-L``, ``--list``: Instead of using shell globs to evaluate the target\n servers, take a comma or space delimited list of servers.\n- ``-G``, ``--grain``: Instead of using shell globs to evaluate the target\n use a grain value to identify targets, the syntax for the target is the grain\n key followed by a globexpression: ``\"os:Arch*\"``.\n- ``-P``, ``--grain-pcre``: Instead of using shell globs to evaluate the target\n use a grain value to identify targets, the syntax for the target is the grain\n key followed by a pcre regular expression: \"os:Arch.*\".\n- ``-N``, ``--nodegroup``: Instead of using shell globs to evaluate the target\n use one of the predefined nodegroups to identify a list of targets.\n- ``-R``, ``--range``: Instead of using shell globs to evaluate the target\n use a range expression to identify targets. Range expressions look like\n %cluster.\n\n.. warning::\n\n Some of the targeting options above may not be available for some Roster\n modules.\n\nTo use a specific Roster, configure the ``proxy_roster`` option into your\nMaster config file, e.g.,\n\n.. code-block:: yaml\n\n proxy_roster: ansible\n\nWith the configuration above, ``salt-sproxy`` would try to use the `ansbile \nRoster module \n<https://docs.saltstack.com/en/latest/ref/roster/all/salt.roster.ansible.html#module-salt.roster.ansible>`_\nto compile the Roster file (typically ``/etc/salt/roster``) which is structured \nas a regular Ansible Inventory file. This inventory should only provide the \nlist of devices.\n\nThe Roster can also be specified on the fly, using the ``-R`` or ``--roster`` \noptions, e.g., ``salt-sproxy cr1.thn.lon test.ping --roster=flat``. In this\nexample, we'd be using the `flat Roster module \n<https://docs.saltstack.com/en/latest/ref/roster/all/salt.roster.flat.html#module-salt.roster.flat>`_ \nto determine the list of devices matched by a specific target.\n\nWhen you don't specify the Roster into the Master config, or from the CLI, you \ncan use ``salt-sproxy`` to target on or more devices using the ``glob`` or \n``list`` target types, e.g., ``salt-sproxy cr1.thn.lon test.ping`` (glob) or \n``salt-sproxy -L cr1.thn.lon,cr2.thn.lon test.ping`` (to target a list of \ndevices, cr1.thn.lon and cr2.thn.lon, respectively).\n\nNote that in any case (with or without the Roster), you will need to provide \na valid list of Minions.\n",
"bugtrack_url": null,
"license": "Apache License 2.0",
"summary": "Salt plugin for managing devices and applications, without running (Proxy) Minions",
"version": "2023.8.0",
"project_urls": {
"CI: GitHub Actions": "https://github.com/mirceaulinic/salt-sproxy/actions",
"Docs: RTD": "https://salt-sproxy.readthedocs.io/",
"GitHub: issues": "https://github.com/mirceaulinic/salt-sproxy/issues",
"GitHub: repo": "https://github.com/mirceaulinic/salt-sproxy",
"Homepage": "https://github.com/mirceaulinic/salt-sproxy"
},
"split_keywords": [
"salt",
"network",
"automation",
"cli",
"proxy",
"minion",
"salt-extension"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e07bedb25c58faf71575abaa0c07c083fb9bb71a082591651bef46d3345a120f",
"md5": "1291508a6746077d010cbf295085e9f7",
"sha256": "d1ebbdf994185a1b4b3c8017cae9f158b27d9acdb5aff8164dc21306624c69ef"
},
"downloads": -1,
"filename": "salt_sproxy-2023.8.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "1291508a6746077d010cbf295085e9f7",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 112817,
"upload_time": "2023-08-02T15:38:57",
"upload_time_iso_8601": "2023-08-02T15:38:57.766454Z",
"url": "https://files.pythonhosted.org/packages/e0/7b/edb25c58faf71575abaa0c07c083fb9bb71a082591651bef46d3345a120f/salt_sproxy-2023.8.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "80d4865caa6c92566557bdfda37f9e3cdf243f9a9807bf04fb055c636dadd1ea",
"md5": "6c76c66d30137fd8bd34e50b2948ac15",
"sha256": "204b66a80b23caa9ccf12fdef89b748a1ccf0976f121f3e1a9dace2a9ceff75b"
},
"downloads": -1,
"filename": "salt-sproxy-2023.8.0.tar.gz",
"has_sig": false,
"md5_digest": "6c76c66d30137fd8bd34e50b2948ac15",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 111859,
"upload_time": "2023-08-02T15:39:00",
"upload_time_iso_8601": "2023-08-02T15:39:00.321453Z",
"url": "https://files.pythonhosted.org/packages/80/d4/865caa6c92566557bdfda37f9e3cdf243f9a9807bf04fb055c636dadd1ea/salt-sproxy-2023.8.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-02 15:39:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mirceaulinic",
"github_project": "salt-sproxy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "salt-sproxy"
}