Skip to content

Commit

Permalink
Document alternative easy setup using Docker
Browse files Browse the repository at this point in the history
Currently only for 101, NAPALM, and Ansible; the rest to be documented
later.
  • Loading branch information
mirceaulinic committed Jun 21, 2019
1 parent 9314099 commit 44e722d
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/index.rst
Expand Up @@ -215,6 +215,8 @@ 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.

.. _docker:

Docker
------

Expand Down
23 changes: 23 additions & 0 deletions examples/101/README.rst
Expand Up @@ -84,3 +84,26 @@ Having this setup ready, you can go ahead an execute:
2019.3.9
cffi:
1.12.3
.. _example-101-easy:

Alternative setup using Docker
------------------------------

1. Clone the salt-sproxy repository and change dir:

.. code-block:: bash
$ git clone https://github.com/mirceaulinic/salt-sproxy.git
$ cd salt-sproxy/
2. Using the ``allinone-latest`` Docker image (see :ref:`docker`), you can run
from this path:

.. code-block:: bash
$ docker run --rm -v $PWD/examples/101/pillar/:/srv/salt/pillar/ \
-ti mirceaulinic/salt-sproxy:allinone-latest bash
root@2c68721d93dc:/# salt-sproxy minion1 test.ping -l error
minion1:
True
60 changes: 60 additions & 0 deletions examples/ansible/README.rst
Expand Up @@ -159,3 +159,63 @@ Having this setup ready, you can go ahead an execute:
~~~ snip ~~~
edge2.atlanta:
~~~ snip ~~~
.. _example-ansible-easy:

Alternative setup using Docker
------------------------------

1. Clone the salt-sproxy repository and change dir:

.. code-block:: bash
$ git clone https://github.com/mirceaulinic/salt-sproxy.git
$ cd salt-sproxy/
2. Update ``examples/ansible/roster`` with your Ansible inventory.


3. Update ``examples/ansible/top.sls`` to ensure your Pillar Top file matches
the name of the devices from your Roster / Ansible inventory.
Also, update the ``examples/ansible/eos.sls``, ``examples/ansible/junos.sls``
etc. files with your credentials to connect to your device(s).

To double check that the mapping is correct, you can execute:

.. code-block:: bash
$ docker run --rm -v $PWD/examples/ansible/master:/etc/salt/master \
-v $PWD/examples/ansible/roster:/etc/salt/roster \
-v $PWD/examples/ansible/pillar/:/srv/salt/pillar/ \
-ti mirceaulinic/salt-sproxy:allinone-latest bash
root@2c68721d93dc:/# salt-run pillar.show_pillar edge1.atlanta
proxy:
----------
proxytype:
napalm
driver:
junos
hostname:
edge1-atlanta.salt-sproxy.digitalocean.cloud.tesuto.com
username:
test
password:
t35t1234
4. Using the ``allinone-latest`` Docker image (see :ref:`docker`), you can run
from this path:

.. code-block:: bash
$ docker run --rm -v $PWD/examples/ansible/master:/etc/salt/master \
-v $PWD/examples/ansible/roster:/etc/salt/roster \
-v $PWD/examples/ansible/pillar/:/srv/salt/pillar/ \
--network host \
-ti mirceaulinic/salt-sproxy:allinone-latest bash
root@2c68721d93dc:/# salt-sproxy -N southwest test.ping
edge1.la:
True
edge1.sfo:
True
43 changes: 43 additions & 0 deletions examples/napalm/README.rst
Expand Up @@ -151,3 +151,46 @@ through this checklist: https://github.com/napalm-automation/napalm#faq.
of the most widely used State modules for configuration management through
NAPALM being `Netconfig
<https://docs.saltstack.com/en/latest/ref/states/all/salt.states.netconfig.html>`__.
.. _example-napalm-easy:
Alternative setup using Docker
------------------------------
1. Clone the salt-sproxy repository and change dir:
.. code-block:: bash
$ git clone https://github.com/mirceaulinic/salt-sproxy.git
$ cd salt-sproxy/
2. Update the ``examples/napalm/junos.sls`` file with your credentials to
connect to your device.
3. Using the ``allinone-latest`` Docker image (see :ref:`docker`), you can run
from this path:
.. code-block:: bash
$ docker run --rm -v $PWD/examples/napalm/pillar/:/srv/salt/pillar/ \
--network host \
-ti mirceaulinic/salt-sproxy:allinone-latest bash
root@2c68721d93dc:/# salt-sproxy juniper-router test.ping
juniper-router:
True
root@2c68721d93dc:/# salt-sproxy juniper-router net.load_config \
text='set system ntp server 10.10.10.1' test=True
juniper-router:
----------
already_configured:
False
comment:
Configuration discarded.
diff:
[edit system]
+ ntp {
+ server 10.10.10.1;
+ }
loaded_config:
result:
True

0 comments on commit 44e722d

Please sign in to comment.