1
0

state.rst 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. .. _proxy-minion-states:
  2. .. versionadded:: 2015.8.2
  3. ===================
  4. Proxy Minion States
  5. ===================
  6. Salt proxy state can be used to deploy, configure and run
  7. a ``salt-proxy`` instance on your minion. Configure proxy settings
  8. on the master side and the state configures and runs ``salt-proxy``
  9. on the remote end.
  10. 1. On your salt-master, ensure that pillar is configured properly. Select an ID
  11. for your proxy (in this example we will name the proxy 'p8000').
  12. In your pillar topfile, place an entry for your proxy:
  13. .. code-block:: yaml
  14. base:
  15. 'p8000':
  16. - p8000
  17. This says that Salt's pillar should load some values for the proxy ``p8000``
  18. from the file ``/srv/pillar/p8000.sls`` (if you have not changed your default pillar_roots)
  19. 2. In the pillar root for your base environment, create the ``p8000.sls`` file with the
  20. following contents:
  21. .. code-block:: yaml
  22. proxy:
  23. # set proxytype for your proxymodule
  24. proxytype: ssh_sample
  25. host: saltyVM
  26. username: salt
  27. password: badpass
  28. 3. Create the following state in your state tree
  29. (let's name it salt_proxy.sls)
  30. .. code-block:: yaml
  31. salt-proxy-configure:
  32. salt_proxy.configure_proxy:
  33. - proxyname: p8000
  34. - start: True # start the process if it isn't running
  35. 4. Make sure your salt-master and salt-minion are running.
  36. 5. Run the state salt_proxy on the minion where you want to run ``salt-proxy``
  37. Example using ``state.sls`` to configure and run ``salt-proxy``
  38. .. code-block:: bash
  39. # salt device_minion state.sls salt_proxy
  40. This starts salt-proxy on ``device_minion``
  41. 6. Accept your proxy's key on your salt-master
  42. .. code-block:: bash
  43. salt-key -y -a p8000
  44. The following keys are going to be accepted:
  45. Unaccepted Keys:
  46. p8000
  47. Key for minion p8000 accepted.
  48. 7. Now you should be able to run commands on your proxy.
  49. .. code-block:: bash
  50. salt p8000 pkg.list_pkgs