ssh.rst 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 this file:
  26. .. code-block:: yaml
  27. p8000.sls
  28. ---------
  29. proxy:
  30. proxytype: ssh_sample
  31. host: saltyVM
  32. username: salt
  33. password: badpass
  34. 4. Make sure your salt-master is running.
  35. 5. Start the salt-proxy in debug mode
  36. .. code-block:: bash
  37. salt-proxy --proxyid=p8000 -l debug
  38. 6. Accept your proxy's key on your salt-master
  39. .. code-block:: bash
  40. salt-key -y -a p8000
  41. The following keys are going to be accepted:
  42. Unaccepted Keys:
  43. p8000
  44. Key for minion p8000 accepted.
  45. 7. Now you should be able to run commands on your proxy.
  46. .. code-block:: bash
  47. salt p8000 pkg.list_pkgs
  48. 8. The SSH shell implements a degenerately simple pkg.
  49. To "install" a package, use a standard
  50. ``pkg.install``. If you pass '==' and a verrsion number after the package
  51. name then the service will parse that and accept that as the package's
  52. version.