1
0

ssh.rst 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. .. _proxy-minion-ssh-end-to-end-example:
  2. ========================================
  3. Salt Proxy Minion SSH End-to-End Example
  4. ========================================
  5. The following is walkthrough that documents how to run a sample SSH service
  6. and configure one or more proxy minions to talk to and control it.
  7. 1. This walkthrough uses a custom SSH shell to provide an end to end example.
  8. Any other shells can be used too.
  9. 2. Setup the proxy command shell as shown https://github.com/saltstack/salt-contrib/tree/master/proxyminion_ssh_example
  10. Now, configure your salt-proxy.
  11. 1. Edit ``/etc/salt/proxy`` and add an entry for your master's location
  12. .. code-block:: yaml
  13. master: localhost
  14. multiprocessing: False
  15. 2. On your salt-master, ensure that pillar is configured properly. Select an ID
  16. for your proxy (in this example we will name the proxy with the letter 'p'
  17. followed by the port the proxy is answering on). In your pillar topfile,
  18. place an entry for your proxy:
  19. .. code-block:: yaml
  20. base:
  21. 'p8000':
  22. - p8000
  23. This says that Salt's pillar should load some values for the proxy ``p8000``
  24. from the file ``/srv/pillar/p8000.sls`` (if you have not changed your default pillar_roots)
  25. 3. In the pillar root for your base environment, create the ``p8000.sls`` file with the
  26. following contents:
  27. .. code-block:: yaml
  28. proxy:
  29. proxytype: ssh_sample
  30. host: saltyVM
  31. username: salt
  32. password: badpass
  33. 4. Make sure your salt-master is running.
  34. 5. Start the salt-proxy in debug mode
  35. .. code-block:: bash
  36. salt-proxy --proxyid=p8000 -l debug
  37. 6. Accept your proxy's key on your salt-master
  38. .. code-block:: bash
  39. salt-key -y -a p8000
  40. The following keys are going to be accepted:
  41. Unaccepted Keys:
  42. p8000
  43. Key for minion p8000 accepted.
  44. 7. Now you should be able to run commands on your proxy.
  45. .. code-block:: bash
  46. salt p8000 pkg.list_pkgs
  47. 8. The SSH shell implements a degenerately simple pkg.
  48. To "install" a package, use a standard
  49. ``pkg.install``. If you pass '==' and a verrsion number after the package
  50. name then the service will parse that and accept that as the package's
  51. version.